Name – Template
Fred Gandt (talk | contribs) (Much more efficient, and many more catches.) |
Fred Gandt (talk | contribs) (Now handles a few more possible input errors including some likely typos and spelling errors. Also improved template layout for easier maintenance.) |
||
| Line 1: | Line 1: | ||
<includeonly>{{#switch:{{#replace:{{#replace:{{lc:{{{2}}}}}| |}}|:|}} | <includeonly>{{#switch:{{#replace:{{#replace:{{#replace:{{#replace:{{lc:{{{2}}}}}| |}}|:|}}|/|}}|-|}} | ||
|bi | |bi | ||
|bis | |bis | ||
| Line 6: | Line 6: | ||
|bohemiainteractive | |bohemiainteractive | ||
|bohemiainteractivestudio | |bohemiainteractivestudio | ||
|bohemiainteractivestudios={{#switch:{{lc:{{{1}}}}}|img=bi|short=BI| | |bohemiainteractivestudios={{#switch:{{lc:{{{1}}}}} | ||
|img=bi | |||
|short=BI | |||
|#default=Bohemia Interactive}} | |||
|a | |||
|a1 | |||
|arma | |||
|arma1 | |||
|armedassault | |||
|aarmedassault | |||
|a1armedassault | |||
|a2armedassault | |||
|a3armedassault | |||
|armaarmedassault | |||
|arma1armedassault | |||
|arma2armedassault | |||
|arma3armedassault={{#switch:{{lc:{{{1}}}}} | |||
|img=arma | |||
|short=Arma | |||
|#default=Armed Assault}} | |||
|a2 | |||
|arma2={{#switch:{{lc:{{{1}}}}} | |||
|img=arma2 | |||
|short=Arma 2 | |||
|#default=Arma 2}} | |||
|a3 | |||
|arma3={{#switch:{{lc:{{{1}}}}} | |||
|img=arma3 | |||
|short=Arma 3 | |||
|#default=Arma 3}} | |||
|aiv | |aiv | ||
|aaiv | |||
|a1aiv | |||
|a2aiv | |||
|a3aiv | |||
|armaaiv | |armaaiv | ||
|arma1aiv | |||
|arma2aiv | |arma2aiv | ||
|australiansinvietnam | |arma3aiv | ||
| | |austriansinvietnam | ||
| | |aaustriansinvietnam | ||
| | |a1austriansinvietnam | ||
| | |a2austriansinvietnam | ||
|a3austriansinvietnam | |||
|australiansinvietnam | |||
|aaustraliansinvietnam | |||
|armaaustriansinvietnam | |||
|a1australiansinvietnam | |||
|a2australiansinvietnam | |||
|a3australiansinvietnam | |||
|arma1austriansinvietnam | |||
|arma2austriansinvietnam | |||
|arma3austriansinvietnam | |||
|armaaustraliansinvietnam | |||
|arma1australiansinvietnam | |||
|arma2australiansinvietnam | |||
|arma3australiansinvietnam={{#switch:{{lc:{{{1}}}}} | |||
|img=aiv | |||
|short=AiV | |||
|#default=Australians in Vietnam}} | |||
|oa | |oa | ||
|aoa | |||
|a1oa | |||
|a2oa | |||
|a3oa | |||
|armaoa | |armaoa | ||
|arma1oa | |||
|arma2oa | |arma2oa | ||
|arma3oa | |||
|operationarrowhead | |operationarrowhead | ||
|aoperationarrowhead | |||
|a1operationarrowhead | |||
|a2operationarrowhead | |||
|a3operationarrowhead | |||
|armaoperationarrowhead | |armaoperationarrowhead | ||
|arma2operationarrowhead={{#switch:{{lc:{{{1}}}}}|img=arma2oa|short=Arma 2:OA| | |arma1operationarrowhead | ||
|arma2operationarrowhead | |||
|arma3operationarrowhead={{#switch:{{lc:{{{1}}}}} | |||
|img=arma2oa | |||
|short=Arma 2:OA | |||
|#default=Arma 2: Operation Arrowhead}} | |||
|baf | |baf | ||
|abaf | |||
|a1baf | |||
|a2baf | |||
|a3baf | |||
|armabaf | |armabaf | ||
|arma1baf | |||
|arma2baf | |arma2baf | ||
|arma3baf | |||
|britisharmedforces | |britisharmedforces | ||
|abritisharmedforces | |||
|a1britisharmedforces | |||
|a2britisharmedforces | |||
|a3britisharmedforces | |||
|armabritisharmedforces | |armabritisharmedforces | ||
|arma2britisharmedforces={{#switch:{{lc:{{{1}}}}}|img=arma2baf|short=Arma 2:BAF| | |arma1britisharmedforces | ||
|arma2britisharmedforces | |||
|arma3britisharmedforces={{#switch:{{lc:{{{1}}}}} | |||
|img=arma2baf | |||
|short=Arma 2:BAF | |||
|#default=Arma 2: British Armed Forces}} | |||
|pmc | |pmc | ||
|pcm | |||
|apmc | |||
|apcm | |||
|a1pmc | |||
|a1pcm | |||
|a2pmc | |||
|a2pcm | |||
|a3pmc | |||
|a3pcm | |||
|armapmc | |armapmc | ||
|armapcm | |||
|arma1pmc | |||
|arma2pmc | |arma2pmc | ||
|arma3pmc | |||
|arma1pcm | |||
|arma2pcm | |||
|arma3pcm | |||
|privatemilitarycompany | |privatemilitarycompany | ||
|aprivatemilitarycompany | |||
|a1privatemilitarycompany | |||
|a2privatemilitarycompany | |||
|a3privatemilitarycompany | |||
|armaprivatemilitarycompany | |armaprivatemilitarycompany | ||
|arma2privatemilitarycompany={{#switch:{{lc:{{{1}}}}}|img=arma2pmc|short=Arma 2:PMC| | |arma1privatemilitarycompany | ||
|arma2privatemilitarycompany | |||
|arma3privatemilitarycompany={{#switch:{{lc:{{{1}}}}} | |||
|img=arma2pmc | |||
|short=Arma 2:PMC | |||
|#default=Arma 2: Private Military Company}} | |||
|acr | |||
|arc | |arc | ||
|aacr | |||
|aarc | |||
|a1acr | |||
|a1arc | |||
|a2acr | |||
|a2arc | |||
|a3acr | |||
|a3arc | |||
|armaacr | |||
|armaarc | |armaarc | ||
|arma1acr | |||
|arma2acr | |||
|arma3acr | |||
|arma1arc | |||
|arma2arc | |arma2arc | ||
|arma3arc | |||
|armyofczechrepublic | |armyofczechrepublic | ||
|aarmyofczechrepublic | |||
|a1armyofczechrepublic | |||
|a2armyofczechrepublic | |||
|a3armyofczechrepublic | |||
|armaarmyofczechrepublic | |armaarmyofczechrepublic | ||
|arma2armyofczechrepublic={{#switch:{{lc:{{{1}}}}}|img= | |arma1armyofczechrepublic | ||
|arma2armyofczechrepublic | |||
|arma3armyofczechrepublic={{#switch:{{lc:{{{1}}}}} | |||
|img=arma2acr | |||
|short=Arma 2:ACR | |||
|#default=Arma 2: Army of Czech Republic}} | |||
|zeus | |zeus | ||
|zues | |||
|azeus | |||
|a1zeus | |||
|a2zeus | |||
|a3zeus | |||
|azues | |||
|a1zues | |||
|a2zues | |||
|a3zues | |||
|armazeus | |armazeus | ||
|arma3zeus={{#switch:{{lc:{{{1}}}}}|img=zeus|short=Zeus| | |armazues | ||
|arma1zeus | |||
|arma2zeus | |||
|arma3zeus | |||
|arma1zues | |||
|arma2zues | |||
|arma3zues={{#switch:{{lc:{{{1}}}}} | |||
|img=zeus | |||
|short=Zeus | |||
|#default=Arma 3: Zeus}} | |||
|ofp | |ofp | ||
|aofp | |||
|a1ofp | |||
|a2ofp | |||
|a3ofp | |||
|armaofp | |armaofp | ||
|arma1ofp | |||
|arma2ofp | |arma2ofp | ||
|arma3ofp | |||
|operationflashpoint | |operationflashpoint | ||
|aoperationflashpoint | |||
|a1operationflashpoint | |||
|a2operationflashpoint | |||
|a3operationflashpoint | |||
|armaoperationflashpoint | |armaoperationflashpoint | ||
|arma2operationflashpoint={{#switch:{{lc:{{{1}}}}}|img=ofp|short=OFP| | |arma1operationflashpoint | ||
|arma2operationflashpoint | |||
|arma3operationflashpoint={{#switch:{{lc:{{{1}}}}} | |||
|img=ofp | |||
|short=OFP | |||
|#default=Operation Flashpoint}} | |||
|ofpe | |ofpe | ||
|aofpe | |||
|a1ofpe | |||
|a2ofpe | |||
|a3ofpe | |||
|armaofpe | |armaofpe | ||
|arma1ofpe | |||
|arma2ofpe | |arma2ofpe | ||
|arma3ofpe | |||
|ofpelite | |ofpelite | ||
|aofpelite | |||
|a1ofpelite | |||
|a2ofpelite | |||
|a3ofpelite | |||
|armaofpelite | |armaofpelite | ||
|arma1ofpelite | |||
|arma2ofpelite | |arma2ofpelite | ||
|arma3ofpelite | |||
|operationflashpointe | |||
|aoperationflashpointe | |||
|a1operationflashpointe | |||
|a2operationflashpointe | |||
|a3operationflashpointe | |||
|operationflashpointelite | |operationflashpointelite | ||
|armaoperationflashpointe | |||
|arma1operationflashpointe | |||
|arma2operationflashpointe | |||
|arma3operationflashpointe | |||
|aoperationflashpointelite | |||
|a1operationflashpointelite | |||
|a2operationflashpointelite | |||
|a3operationflashpointelite | |||
|armaoperationflashpointelite | |armaoperationflashpointelite | ||
|arma2operationflashpointelite={{#switch:{{lc:{{{1}}}}}|img=ofpe|short=OFP:E| | |arma1operationflashpointelite | ||
|arma2operationflashpointelite | |||
|arma3operationflashpointelite={{#switch:{{lc:{{{1}}}}} | |||
|img=ofpe | |||
|short=OFP:E | |||
|#default=Operation Flashpoint: Elite}} | |||
|ofpr | |ofpr | ||
|aofpr | |||
|a1ofpr | |||
|a2ofpr | |||
|a3ofpr | |||
|armaofpr | |armaofpr | ||
|arma1ofpr | |||
|arma2ofpr | |arma2ofpr | ||
|arma3ofpr | |||
|ofpresistance | |ofpresistance | ||
|aofpresistance | |||
|a1ofpresistance | |||
|a2ofpresistance | |||
|a3ofpresistance | |||
|armaofpresistance | |armaofpresistance | ||
|arma1ofpresistance | |||
|arma2ofpresistance | |arma2ofpresistance | ||
|arma3ofpresistance | |||
|operationflashpointr | |||
|aoperationflashpointr | |||
|a1operationflashpointr | |||
|a2operationflashpointr | |||
|a3operationflashpointr | |||
|armaoperationflashpointr | |||
|arma1operationflashpointr | |||
|arma2operationflashpointr | |||
|arma3operationflashpointr | |||
|operationflashpointresistance | |operationflashpointresistance | ||
|aoperationflashpointresistance | |||
|a1operationflashpointresistance | |||
|a2operationflashpointresistance | |||
|a3operationflashpointresistance | |||
|armaoperationflashpointresistance | |armaoperationflashpointresistance | ||
|arma2operationflashpointresistance={{#switch:{{lc:{{{1}}}}}|img=ofpr|short=OFP:R| | |arma1operationflashpointresistance | ||
|arma2operationflashpointresistance | |||
|arma3operationflashpointresistance={{#switch:{{lc:{{{1}}}}} | |||
|img=ofpr | |||
|short=OFP:R | |||
|#default=Operation Flashpoint: Resistance}} | |||
|vbs | |vbs | ||
|vbs1 | |vbs1 | ||
|virtualbattlespace={{#switch:{{lc:{{{1}}}}}|img=vbs1|short=VBS1| | |avbs | ||
|a1vbs | |||
|a2vbs | |||
|a3vbs | |||
|avbs1 | |||
|a1vbs1 | |||
|a2vbs1 | |||
|a3vbs1 | |||
|armavbs | |||
|armavbs1 | |||
|arma1vbs | |||
|arma2vbs | |||
|arma3vbs | |||
|arma1vbs1 | |||
|arma2vbs1 | |||
|arma3vbs1 | |||
|virtualbattlespace | |||
|virtualbattlespace1 | |||
|avirtualbattlespace | |||
|a1virtualbattlespace | |||
|a2virtualbattlespace | |||
|a3virtualbattlespace | |||
|avirtualbattlespace1 | |||
|a1virtualbattlespace1 | |||
|a2virtualbattlespace1 | |||
|a3virtualbattlespace1 | |||
|armavirtualbattlespace | |||
|armavirtualbattlespace1 | |||
|arma1virtualbattlespace | |||
|arma2virtualbattlespace | |||
|arma3virtualbattlespace | |||
|arma1virtualbattlespace1 | |||
|arma2virtualbattlespace1 | |||
|arma3virtualbattlespace1={{#switch:{{lc:{{{1}}}}} | |||
|img=vbs1 | |||
|short=VBS1 | |||
|#default=Virtual Battlespace 1}} | |||
|vbs2 | |vbs2 | ||
|virtualbattlespace2={{#switch:{{lc:{{{1}}}}}|img=vbs2|short=VBS2| | |avbs2 | ||
|a1vbs2 | |||
|a2vbs2 | |||
|a3vbs2 | |||
|armavbs2 | |||
|arma1vbs2 | |||
|arma2vbs2 | |||
|arma3vbs2 | |||
|virtualbattlespace2 | |||
|avirtualbattlespace2 | |||
|a1virtualbattlespace2 | |||
|a2virtualbattlespace2 | |||
|a3virtualbattlespace2 | |||
|armavirtualbattlespace2 | |||
|arma1virtualbattlespace2 | |||
|arma2virtualbattlespace2 | |||
|arma3virtualbattlespace2={{#switch:{{lc:{{{1}}}}} | |||
|img=vbs2 | |||
|short=VBS2 | |||
|#default=Virtual Battlespace 2}} | |||
|vbs3 | |vbs3 | ||
|virtualbattlespace3={{#switch:{{lc:{{{1}}}}}|img=vbs3|short=VBS3| | |avbs3 | ||
|a1vbs3 | |||
|a2vbs3 | |||
|a3vbs3 | |||
|armavbs3 | |||
|arma1vbs3 | |||
|arma2vbs3 | |||
|arma3vbs3 | |||
|virtualbattlespace3 | |||
|avirtualbattlespace3 | |||
|a1virtualbattlespace3 | |||
|a2virtualbattlespace3 | |||
|a3virtualbattlespace3 | |||
|armavirtualbattlespace3 | |||
|arma1virtualbattlespace3 | |||
|arma2virtualbattlespace3 | |||
|arma3virtualbattlespace3={{#switch:{{lc:{{{1}}}}} | |||
|img=vbs3 | |||
|short=VBS3 | |||
|#default=Virtual Battlespace 3}} | |||
|toh | |||
|tkoh | |tkoh | ||
| | |atoh | ||
|takeonhelicopters={{#switch:{{lc:{{{1}}}}}|img=TKOH|short=TKOH| | |a1toh | ||
|a2toh | |||
|a3toh | |||
|atkoh | |||
|a1tkoh | |||
|a2tkoh | |||
|a3tkoh | |||
|armatoh | |||
|armatkoh | |||
|arma1toh | |||
|arma2toh | |||
|arma3toh | |||
|arma1tkoh | |||
|arma2tkoh | |||
|arma3tkoh | |||
|takeonhelicopters | |||
|atakeonhelicopters | |||
|a1takeonhelicopters | |||
|a2takeonhelicopters | |||
|a3takeonhelicopters | |||
|armatakeonhelicopters | |||
|armatakeonhelicopters | |||
|arma1takeonhelicopters | |||
|arma2takeonhelicopters | |||
|arma3takeonhelicopters | |||
|arma1takeonhelicopters | |||
|arma2takeonhelicopters | |||
|arma3takeonhelicopters={{#switch:{{lc:{{{1}}}}} | |||
|img=TKOH | |||
|short=TKOH | |||
|#default=Take On Helicopters}} | |||
|tom | |||
|tkom | |tkom | ||
| | |atom | ||
|takeonmars={{#switch:{{lc:{{{1}}}}}|img=TKOM|short=TKOM| | |a1tom | ||
|#default={{{2}}}}}</includeonly><noinclude> | |a2tom | ||
|a3tom | |||
|atkom | |||
|a1tkom | |||
|a2tkom | |||
|a3tkom | |||
|armatom | |||
|armatkom | |||
|arma1tom | |||
|arma2tom | |||
|arma3tom | |||
|arma1tkom | |||
|arma2tkom | |||
|arma3tkom | |||
|takeonmars | |||
|atakeonmars | |||
|a1takeonmars | |||
|a2takeonmars | |||
|a3takeonmars | |||
|armatakeonmars | |||
|armatakeonmars | |||
|arma1takeonmars | |||
|arma2takeonmars | |||
|arma3takeonmars | |||
|arma1takeonmars | |||
|arma2takeonmars | |||
|arma3takeonmars={{#switch:{{lc:{{{1}}}}} | |||
|img=TKOM | |||
|short=TKOM | |||
|#default=Take On Mars}} | |||
|#default='''[[Bohemia_Interactive_Community:Naming_Conventions|{{{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 86: | Line 444: | ||
Please add any switch cases omitted, or if unsure about how to do it, leave a message on [[Template talk:Game name|the talk page]].}} | Please add any switch cases omitted, or if unsure about how to do it, leave a message on [[Template talk:Game name|the talk page]].}} | ||
==Usage== | ==Usage== | ||
;Takes two parameters | ;Takes two parameters | ||
:The first parameter is the format request. Either "''img''", "''short''" or "''long''" | :The first parameter is the format request. Either "''img''", "''short''" or "''long''" (the long name is returned by default). | ||
:The second parameter is the input string to be verified or corrected. | :The second parameter is the input string to be verified or corrected. | ||
Will return the input string if no matches are found. | Will return the input string linked to [[Bohemia_Interactive_Community:Naming_Conventions|Naming Conventions]] if no matches are found. | ||
:''e.g.'' {{Inline code|<nowiki>{{Game name|long|wjhbvkwfk}}</nowiki>}} produces "{{Game name|long|wjhbvkwfk}}". | |||
===Examples=== | ===Examples=== | ||
*{{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}}" and correctly interprets a possible typo. | ||
*{{Inline code|<nowiki>{{Game name|long|ArmA 2: OFP: E}}</nowiki>}} produces "{{Game name|long|ArmA 2: OFP: E}}" | *{{Inline code|<nowiki>{{Game name|long|ArmA 2: OFP: E}}</nowiki>}} produces "{{Game name|long|ArmA 2: OFP: E}}" | ||
*{{Inline code|<nowiki>{{Game name| | *{{Inline code|<nowiki>{{Game name|doesn't actually matter if we want the long name|A1 Zues}}</nowiki>}} produces "{{Game name|doesn't actually matter if we want the long name|A1 Zues}}" even though "Zeus" is both spelled incorrectly and is an Arma 3 DLC! | ||
''etc.'' | :''etc.'' - You get the idea :-) | ||
In other words, it takes a multitude of possible (slightly and wildly incorrect) interpretations (including several possible typos) of how BI games should be named, and returns the conventionally correct version required, depending on circumstance. | |||
===Handling=== | |||
{| class="wikitable" style="width:600px;" | |||
|+ The following naming conventions are handled | |||
|- | |||
! Full Name !! Short Name !! Image Link Prefix | |||
|- | |||
| Bohemia Interactive || BI || bi | |||
|- | |||
| Armed Assault || Arma || arma | |||
|- | |||
| Arma 2 || Arma 2 || arma2 | |||
|- | |||
| Arma 3 || Arma 3 || arma3 | |||
|- | |||
| Australians in Vietnam || AiV || aiv | |||
|- | |||
| Arma 2: Operation Arrowhead || Arma 2:OA || arma2oa | |||
|- | |||
| Arma 2: British Armed Forces || Arma 2:BAF || arma2baf | |||
|- | |||
| Arma 2: Private Military Company || Arma 2:PMC || arma2pmc | |||
|- | |||
| Arma 2: Army of Czech Republic || Arma 2:ACR || arma2acr | |||
|- | |||
| Arma 3: Zeus || Zeus || zeus | |||
|- | |||
| Operation Flashpoint || OFP || ofp | |||
|- | |||
| Operation Flashpoint: Elite || OFP:E || ofpe | |||
|- | |||
| Operation Flashpoint: Resistance || OFP:R || ofpr | |||
|- | |||
| Virtual Battlespace 1 || VBS1 || vbs1 | |||
|- | |||
| Virtual Battlespace 2 || VBS2 || vbs2 | |||
|- | |||
| Virtual Battlespace 3 || VBS3 || vbs3 | |||
|- | |||
| Take On Helicopters || TKOH || TKOH | |||
|- | |||
| Take On Mars || TKOM || TKOM | |||
|} | |||
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude> | [[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude> | ||
Revision as of 03:01, 30 April 2014
Usage
- Takes two parameters
- The first parameter is the format request. Either "img", "short" or "long" (the long name is returned by default).
- The second parameter is the input string to be verified or corrected.
Will return the input string linked to Naming Conventions if no matches are found.
- e.g.
{{Game name|long|wjhbvkwfk}}produces "Template:Game name".
Examples
{{Game name|img|ArmA 2}}produces "Template:Game name"{{Game name|short|arma:arc}}produces "Template:Game name" and correctly interprets a possible typo.{{Game name|long|ArmA 2: OFP: E}}produces "Template:Game name"{{Game name|doesn't actually matter if we want the long name|A1 Zues}}produces "Template:Game name" even though "Zeus" is both spelled incorrectly and is an Arma 3 DLC!
- etc. - You get the idea :-)
In other words, it takes a multitude of possible (slightly and wildly incorrect) interpretations (including several possible typos) of how BI games should be named, and returns the conventionally correct version required, depending on circumstance.
Handling
| Full Name | Short Name | Image Link Prefix |
|---|---|---|
| Bohemia Interactive | BI | bi |
| Armed Assault | Arma | arma |
| Arma 2 | Arma 2 | arma2 |
| Arma 3 | Arma 3 | arma3 |
| Australians in Vietnam | AiV | aiv |
| Arma 2: Operation Arrowhead | Arma 2:OA | arma2oa |
| Arma 2: British Armed Forces | Arma 2:BAF | arma2baf |
| Arma 2: Private Military Company | Arma 2:PMC | arma2pmc |
| Arma 2: Army of Czech Republic | Arma 2:ACR | arma2acr |
| Arma 3: Zeus | Zeus | zeus |
| Operation Flashpoint | OFP | ofp |
| Operation Flashpoint: Elite | OFP:E | ofpe |
| Operation Flashpoint: Resistance | OFP:R | ofpr |
| Virtual Battlespace 1 | VBS1 | vbs1 |
| Virtual Battlespace 2 | VBS2 | vbs2 |
| Virtual Battlespace 3 | VBS3 | vbs3 |
| Take On Helicopters | TKOH | TKOH |
| Take On Mars | TKOM | TKOM |