Template:Parse source: Difference between revisions
More actions
... obviously ucfirst |
m add a tag for tracking files that use non-English phrase |
||
| Line 2: | Line 2: | ||
<!-- Try common variations and failed templates --> | <!-- Try common variations and failed templates --> | ||
|Own | |Own | ||
|Ownwork={{Own}} | |Ownwork={{Own}}{{Parse source tag}} | ||
<!-- Try all the translations of MediaWiki:UploadFormOwnWorkLabel --> | <!-- Try all the translations of MediaWiki:UploadFormOwnWorkLabel --> | ||
|<!-- MediaWiki:UploadFormOwnWorkLabel/af --> Oplaaier se eie werk (uploader's own work) | |<!-- MediaWiki:UploadFormOwnWorkLabel/af --> Oplaaier se eie werk (uploader's own work) | ||
| Line 46: | Line 46: | ||
|<!-- MediaWiki:UploadFormOwnWorkLabel/vi --> Tác phẩm do chính người tải lên tạo ra (own work by uploader) | |<!-- MediaWiki:UploadFormOwnWorkLabel/vi --> Tác phẩm do chính người tải lên tạo ra (own work by uploader) | ||
|<!-- MediaWiki:UploadFormOwnWorkLabel/zh --> 上传者自己的作品 (own work) | |<!-- MediaWiki:UploadFormOwnWorkLabel/zh --> 上传者自己的作品 (own work) | ||
|<!-- MediaWiki:UploadFormOwnWorkLabel/zh-hant --> 上載者自己的作品 (own work)={{Own}} | |<!-- MediaWiki:UploadFormOwnWorkLabel/zh-hant --> 上載者自己的作品 (own work)={{Own}}{{Parse source tag}} | ||
<!-- Try all the translations in Template:Own --> | <!-- Try all the translations in Template:Own --> | ||
|<!-- af -->Eie werk | |<!-- af -->Eie werk | ||
| Line 100: | Line 100: | ||
|<!-- vi -->Tác phẩm do chính người tải lên tạo ra | |<!-- vi -->Tác phẩm do chính người tải lên tạo ra | ||
|<!-- zh -->上传者自己的作品 | |<!-- zh -->上传者自己的作品 | ||
|<!-- zh-hant -->上載者自己的作品={{own}} | |<!-- zh-hant -->上載者自己的作品={{own}}{{Parse source tag}} | ||
<!-- Can't parse it, just return it --> | <!-- Can't parse it, just return it --> | ||
| {{{1|}}} | | {{{1|}}} | ||
Revision as of 03:21, 8 February 2012
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}}