Name – Template
Jump to navigation
Jump to search
Fred Gandt (talk | contribs) (Greatly extended range of possible misconfigured inputs to handle. Added 3rd type of output. >> Unsure of correct "Zeus" convention(s) <<) |
Fred Gandt (talk | contribs) (Much more efficient, and many more catches.) |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch:{{lc:{{{2}}}}} | <includeonly>{{#switch:{{#replace:{{#replace:{{lc:{{{2}}}}}| |}}|:|}} | ||
|bi | |bi | ||
|bis | |bis | ||
| | |bistudio | ||
| | |bistudios | ||
|bohemiainteractive | |||
|bohemiainteractivestudio | |||
|bohemiainteractivestudios={{#switch:{{lc:{{{1}}}}}|img=bi|short=BI|long=Bohemia Interactive|#default={{{2}}}}} | |||
|aiv | |aiv | ||
|armaaiv | |armaaiv | ||
|arma2aiv | |arma2aiv | ||
| | |australiansinvietnam={{#switch:{{lc:{{{1}}}}}|img=aiv|short=AiV|long=Australians in Vietnam|#default={{{2}}}}} | ||
|arma | |arma | ||
|arma1 | |arma1 | ||
| | |armedassault={{#switch:{{lc:{{{1}}}}}|img=arma|short=Arma|long=Armed Assault|#default={{{2}}}}} | ||
|arma2 | |arma2={{#switch:{{lc:{{{1}}}}}|img=arma2|short=Arma 2|long=Arma 2|#default={{{2}}}}} | ||
|oa | |oa | ||
|armaoa | |armaoa | ||
|arma2oa | |arma2oa | ||
| | |operationarrowhead | ||
| | |armaoperationarrowhead | ||
| | |arma2operationarrowhead={{#switch:{{lc:{{{1}}}}}|img=arma2oa|short=Arma 2:OA|long=Arma 2: Operation Arrowhead|#default={{{2}}}}} | ||
|baf | |baf | ||
|armabaf | |armabaf | ||
|arma2baf | |arma2baf | ||
| | |britisharmedforces | ||
| | |armabritisharmedforces | ||
| | |arma2britisharmedforces={{#switch:{{lc:{{{1}}}}}|img=arma2baf|short=Arma 2:BAF|long=Arma 2: British Armed Forces|#default={{{2}}}}} | ||
|pmc | |pmc | ||
|armapmc | |armapmc | ||
|arma2pmc | |arma2pmc | ||
| | |privatemilitarycompany | ||
| | |armaprivatemilitarycompany | ||
| | |arma2privatemilitarycompany={{#switch:{{lc:{{{1}}}}}|img=arma2pmc|short=Arma 2:PMC|long=Arma 2: Private Military Company|#default={{{2}}}}} | ||
|arc | |arc | ||
|armaarc | |armaarc | ||
|arma2arc | |arma2arc | ||
| | |armyofczechrepublic | ||
| | |armaarmyofczechrepublic | ||
| | |arma2armyofczechrepublic={{#switch:{{lc:{{{1}}}}}|img=arma2arc|short=Arma 2:ARC|long=Arma 2: Army of Czech Republic|#default={{{2}}}}} | ||
|arma3={{#switch:{{lc:{{{1}}}}}|img=arma3|short=Arma 3|long=Arma 3|#default={{{2}}}}} | |||
|arma3 | |||
|zeus | |zeus | ||
| | |armazeus | ||
| | |arma3zeus={{#switch:{{lc:{{{1}}}}}|img=zeus|short=Zeus|long=Arma 3: Zeus|#default={{{2}}}}}<!-- ?????????????????????? --> | ||
|ofp | |ofp | ||
|armaofp | |armaofp | ||
|arma2ofp | |arma2ofp | ||
| | |operationflashpoint | ||
|armaoperationflashpoint | |||
|arma2operationflashpoint={{#switch:{{lc:{{{1}}}}}|img=ofp|short=OFP|long=Operation Flashpoint|#default={{{2}}}}} | |||
| | |||
| | |||
|ofpe | |ofpe | ||
|armaofpe | |armaofpe | ||
|arma2ofpe | |arma2ofpe | ||
| | |ofpelite | ||
| | |armaofpelite | ||
| | |arma2ofpelite | ||
| | |operationflashpointelite | ||
| | |armaoperationflashpointelite | ||
| | |arma2operationflashpointelite={{#switch:{{lc:{{{1}}}}}|img=ofpe|short=OFP:E|long=Operation Flashpoint: Elite|#default={{{2}}}}} | ||
|ofpr | |ofpr | ||
|armaofpr | |armaofpr | ||
|arma2ofpr | |arma2ofpr | ||
| | |ofpresistance | ||
| | |armaofpresistance | ||
| | |arma2ofpresistance | ||
| | |operationflashpointresistance | ||
| | |armaoperationflashpointresistance | ||
| | |arma2operationflashpointresistance={{#switch:{{lc:{{{1}}}}}|img=ofpr|short=OFP:R|long=Operation Flashpoint: Resistance|#default={{{2}}}}} | ||
|vbs | |||
|vbs1 | |vbs1 | ||
| | |virtualbattlespace={{#switch:{{lc:{{{1}}}}}|img=vbs1|short=VBS1|long=Virtual Battlespace 1|#default={{{2}}}}} | ||
|vbs2 | |vbs2 | ||
| | |virtualbattlespace2={{#switch:{{lc:{{{1}}}}}|img=vbs2|short=VBS2|long=Virtual Battlespace 2|#default={{{2}}}}} | ||
|vbs3 | |vbs3 | ||
| | |virtualbattlespace3={{#switch:{{lc:{{{1}}}}}|img=vbs3|short=VBS3|long=Virtual Battlespace 3|#default={{{2}}}}} | ||
|tkoh | |tkoh | ||
|toh={{#switch:{{lc:{{{1}}}}}|img=TKOH|short=TKOH|long=Take On Helicopters|#default={{{2}}}}} | |toh | ||
|takeonhelicopters={{#switch:{{lc:{{{1}}}}}|img=TKOH|short=TKOH|long=Take On Helicopters|#default={{{2}}}}} | |||
|tkom | |tkom | ||
|tom={{#switch:{{lc:{{{1}}}}}|img=TKOM|short=TKOM|long=Take On Mars|#default={{{2}}}}} | |tom | ||
|takeonmars={{#switch:{{lc:{{{1}}}}}|img=TKOM|short=TKOM|long=Take On Mars|#default={{{2}}}}} | |||
|#default={{{2}}}}}</includeonly><noinclude> | |#default={{{2}}}}}</includeonly><noinclude> | ||
{{Important|Not currently in use. Awaiting peer review and feedback, before including in {{Template|Command}} and {{Template|Function}} to correct badly formed entries. | {{Important|Not currently in use. Awaiting peer review and feedback, before including in {{Template|Command}} and {{Template|Function}} to correct badly formed entries. | ||
Line 196: | Line 94: | ||
*{{Inline code|<nowiki>{{Game name|img|ArmA 2}}</nowiki>}} produces "{{Game name|img|ArmA 2}}" | *{{Inline code|<nowiki>{{Game name|img|ArmA 2}}</nowiki>}} produces "{{Game name|img|ArmA 2}}" | ||
*{{Inline code|<nowiki>{{Game name|short|arma:arc}}</nowiki>}} produces "{{Game name|short|arma:arc}}" | *{{Inline code|<nowiki>{{Game name|short|arma:arc}}</nowiki>}} produces "{{Game name|short|arma:arc}}" | ||
*{{Inline code|<nowiki>{{Game name|long|ArmA 2: OFP: E}}</nowiki>}} produces "{{Game name|long|Arma 2: OFP: | *{{Inline code|<nowiki>{{Game name|long|ArmA 2: OFP: E}}</nowiki>}} produces "{{Game name|long|ArmA 2: OFP: E}}" | ||
*{{Inline code|<nowiki>{{Game name|img|Arma 2: OFP: Resistance}}</nowiki>}} produces "{{Game name|img|ArmA 2: OFP: Resistance}}" | |||
''etc.'' | ''etc.'' | ||
Revision as of 07:59, 29 April 2014
Usage
- Takes two parameters
- The first parameter is the format request. Either "img", "short" or "long"
- The second parameter is the input string to be verified or corrected.
Will return the input string if no matches are found.
Examples
{{Game name|img|ArmA 2}}
produces "Template:Game name"{{Game name|short|arma:arc}}
produces "Template:Game name"{{Game name|long|ArmA 2: OFP: E}}
produces "Template:Game name"{{Game name|img|Arma 2: OFP: Resistance}}
produces "Template:Game name"
etc.
In other words, it takes a multitude of possible interpretations of how BI games should be named, and returns the conventionally correct version required, depending on circumstance.