Template:Parse source: Difference between revisions
More actions
m add a tag for tracking files that use non-English phrase |
m Changed protection level for "Template:Parse source": downgraded protection level per consensus ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite)) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{#switch:{{ucfirst:{{lc:{{{1|}}}}}}} | <noinclude>{{heavily used template}}</noinclude>{{#switch:{{ucfirst:{{lc:{{{1|}}}}}}} | ||
<!-- Try common variations and failed templates --> | <!-- Try common variations and failed templates --> | ||
|Own | |Own | ||
Latest revision as of 09:42, 16 July 2019
Usage
This template should only be used in {{Information}} to parse the source field.
The template tries to match the message based on MediaWiki:UploadFormOwnWorkLabel or {{Own}}. When a match is made, the message is returned in the user's interface language.
To add a match based on MediaWiki:UploadFormOwnWorkLabel:
|<!-- MediaWiki:UploadFormOwnWorkLabel/<lang> --> {{subst:ucfirst:{{subst:lc:{{subst:MediaWiki:UploadFormOwnWorkLabel/<lang>}}}}}}
You might want to keep older revisions around or add them.
To add a match based on {{Own}} add:
|<!-- <lang> -->{{subst:ucfirst:{{subst:lc:Own work}}}}
//fhdjuf.hedhefd//!
You have to use the lc and ucfirst functions because the switch statement first converts all characters to lowercase and than the first character to uppercase again (to have case insensitive matching).
The use of {{Own}} in the information template won't cause a template loop ({{Own}} won't match and will just return).
See also
- {{ISOdate}} - Template used to parse the date in {{Information}}