Name – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Greatly extended range of possible misconfigured inputs to handle. Added 3rd type of output. >> Unsure of correct "Zeus" convention(s) <<)
(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
|bohemia interactive studio
|bistudio
|bohemia interactive studios={{#switch:{{lc:{{{1}}}}}|img=bi|short=BI|long=Bohemia Interactive|#default={{{2}}}}}
|bistudios
|bohemiainteractive
|bohemiainteractivestudio
|bohemiainteractivestudios={{#switch:{{lc:{{{1}}}}}|img=bi|short=BI|long=Bohemia Interactive|#default={{{2}}}}}
|aiv
|aiv
|armaaiv
|armaaiv
|arma aiv
|arma2aiv
|arma2aiv
|arma2 aiv
|australiansinvietnam={{#switch:{{lc:{{{1}}}}}|img=aiv|short=AiV|long=Australians in Vietnam|#default={{{2}}}}}
|arma 2aiv
|arma 2 aiv
|arma:aiv
|arma: aiv
|arma2:aiv
|arma2: aiv
|arma 2:aiv
|arma 2: aiv={{#switch:{{lc:{{{1}}}}}|img=aiv|short=AiV|long=Australians in Vietnam|#default={{{2}}}}}
|arma
|arma
|arma1
|arma1
|arma 1={{#switch:{{lc:{{{1}}}}}|img=arma|short=Arma|long=Armed Assault|#default={{{2}}}}}
|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}}}}}
|arma 2={{#switch:{{lc:{{{1}}}}}|img=arma2|short=Arma 2|long=Arma 2|#default={{{2}}}}}
|oa
|oa
|armaoa
|armaoa
|arma oa
|arma:oa
|arma: oa
|arma2oa
|arma2oa
|arma2 oa
|operationarrowhead
|arma 2oa
|armaoperationarrowhead
|arma 2 oa
|arma2operationarrowhead={{#switch:{{lc:{{{1}}}}}|img=arma2oa|short=Arma 2:OA|long=Arma 2: Operation Arrowhead|#default={{{2}}}}}
|arma2:oa
|arma2: oa
|arma 2:oa
|arma 2: oa={{#switch:{{lc:{{{1}}}}}|img=arma2oa|short=Arma 2:OA|long=Arma 2: Operation Arrowhead|#default={{{2}}}}}
|baf
|baf
|armabaf
|armabaf
|arma baf
|arma:baf
|arma: baf
|arma2baf
|arma2baf
|arma2 baf
|britisharmedforces
|arma 2baf
|armabritisharmedforces
|arma 2 baf
|arma2britisharmedforces={{#switch:{{lc:{{{1}}}}}|img=arma2baf|short=Arma 2:BAF|long=Arma 2: British Armed Forces|#default={{{2}}}}}
|arma2:baf
|arma2: baf
|arma 2:baf
|arma 2: baf={{#switch:{{lc:{{{1}}}}}|img=arma2baf|short=Arma 2:BAF|long=Arma 2: British Armed Forces|#default={{{2}}}}}
|pmc
|pmc
|armapmc
|armapmc
|arma pmc
|arma:pmc
|arma: pmc
|arma2pmc
|arma2pmc
|arma2 pmc
|privatemilitarycompany
|arma 2pmc
|armaprivatemilitarycompany
|arma 2 pmc
|arma2privatemilitarycompany={{#switch:{{lc:{{{1}}}}}|img=arma2pmc|short=Arma 2:PMC|long=Arma 2: Private Military Company|#default={{{2}}}}}
|arma2:pmc
|arma2: pmc
|arma 2:pmc
|arma 2: pmc={{#switch:{{lc:{{{1}}}}}|img=arma2pmc|short=Arma 2:PMC|long=Arma 2: Private Military Company|#default={{{2}}}}}
|arc
|arc
|armaarc
|armaarc
|arma arc
|arma:arc
|arma: arc
|arma2arc
|arma2arc
|arma2 arc
|armyofczechrepublic
|arma 2arc
|armaarmyofczechrepublic
|arma 2 arc
|arma2armyofczechrepublic={{#switch:{{lc:{{{1}}}}}|img=arma2arc|short=Arma 2:ARC|long=Arma 2: Army of Czech Republic|#default={{{2}}}}}
|arma2:arc
|arma3={{#switch:{{lc:{{{1}}}}}|img=arma3|short=Arma 3|long=Arma 3|#default={{{2}}}}}
|arma2: arc
|arma 2:arc
|arma 2: arc={{#switch:{{lc:{{{1}}}}}|img=arma2arc|short=Arma 2:ARC|long=Arma 2: Army of Czech Republic|#default={{{2}}}}}
|arma3
|arma 3={{#switch:{{lc:{{{1}}}}}|img=arma3|short=Arma 3|long=Arma 3|#default={{{2}}}}}
|zeus
|zeus
|arma zeus
|armazeus
|arma3 zeus
|arma3zeus={{#switch:{{lc:{{{1}}}}}|img=zeus|short=Zeus|long=Arma 3: Zeus|#default={{{2}}}}}<!-- ?????????????????????? -->
|arma 3zeus
|arma 3 zeus
|arma3:zeus
|arma3: zeus
|arma 3:zeus
|arma 3: zeus={{#switch:{{lc:{{{1}}}}}|img=zeus|short=Zeus|long=Arma 3: Zeus|#default={{{2}}}}}<!-- ?????????????????????? -->
|ofp
|ofp
|armaofp
|armaofp
|arma ofp
|arma:ofp
|arma: ofp
|arma2ofp
|arma2ofp
|arma2 ofp
|operationflashpoint
|arma 2ofp
|armaoperationflashpoint
|arma 2 ofp
|arma2operationflashpoint={{#switch:{{lc:{{{1}}}}}|img=ofp|short=OFP|long=Operation Flashpoint|#default={{{2}}}}}
|arma2:ofp
|arma2: ofp
|arma 2:ofp
|arma 2: ofp={{#switch:{{lc:{{{1}}}}}|img=ofp|short=OFP|long=|#default=Operation Flashpoint{{{2}}}}}
|ofpe
|ofpe
|ofp e
|ofp:e
|ofp: e
|armaofpe
|armaofpe
|arma ofpe
|arma:ofpe
|arma: ofpe
|arma ofp e
|arma: ofp e
|arma:ofp:e
|arma:ofp: e
|arma: ofp:e
|arma: ofp: e
|arma2ofpe
|arma2ofpe
|arma2 ofpe
|ofpelite
|arma2:ofpe
|armaofpelite
|arma2: ofpe
|arma2ofpelite
|arma2 ofp e
|operationflashpointelite
|arma2: ofp e
|armaoperationflashpointelite
|arma2:ofp:e
|arma2operationflashpointelite={{#switch:{{lc:{{{1}}}}}|img=ofpe|short=OFP:E|long=Operation Flashpoint: Elite|#default={{{2}}}}}
|arma2:ofp: e
|arma2: ofp:e
|arma2: ofp: e
|arma 2ofpe
|arma 2 ofpe
|arma 2:ofpe
|arma 2: ofpe
|arma 2 ofp e
|arma 2: ofp e
|arma 2:ofp:e
|arma 2:ofp: e
|arma 2: ofp:e
|arma 2: ofp: e={{#switch:{{lc:{{{1}}}}}|img=ofpe|short=OFP:E|long=Operation Flashpoint: Elite|#default={{{2}}}}}
|ofpr
|ofpr
|ofp r
|ofp:r
|ofp: r
|armaofpr
|armaofpr
|arma ofpr
|arma:ofpr
|arma: ofpr
|arma ofp r
|arma: ofp r
|arma:ofp:r
|arma:ofp: r
|arma: ofp:r
|arma: ofp: r
|arma2ofpr
|arma2ofpr
|arma2 ofpr
|ofpresistance
|arma2:ofpr
|armaofpresistance
|arma2: ofpr
|arma2ofpresistance
|arma2 ofp r
|operationflashpointresistance
|arma2: ofp r
|armaoperationflashpointresistance
|arma2:ofp:r
|arma2operationflashpointresistance={{#switch:{{lc:{{{1}}}}}|img=ofpr|short=OFP:R|long=Operation Flashpoint: Resistance|#default={{{2}}}}}
|arma2:ofp: r
|vbs
|arma2: ofp:r
|arma2: ofp: r
|arma 2ofpr
|arma 2 ofpr
|arma 2:ofpr
|arma 2: ofpr
|arma 2 ofp r
|arma 2: ofp r
|arma 2:ofp:r
|arma 2:ofp: r
|arma 2: ofp:r
|arma 2: ofp: r={{#switch:{{lc:{{{1}}}}}|img=ofpr|short=OFP:R|long=Operation Flashpoint: Resistance|#default={{{2}}}}}
|vbs1
|vbs1
|vbs 1
|virtualbattlespace={{#switch:{{lc:{{{1}}}}}|img=vbs1|short=VBS1|long=Virtual Battlespace 1|#default={{{2}}}}}
|vbs:1
|vbs: 1={{#switch:{{lc:{{{1}}}}}|img=vbs1|short=VBS1|long=Virtual Battlespace 1|#default={{{2}}}}}
|vbs2
|vbs2
|vbs 2
|virtualbattlespace2={{#switch:{{lc:{{{1}}}}}|img=vbs2|short=VBS2|long=Virtual Battlespace 2|#default={{{2}}}}}
|vbs:2
|vbs: 2={{#switch:{{lc:{{{1}}}}}|img=vbs2|short=VBS2|long=Virtual Battlespace 2|#default={{{2}}}}}
|vbs3
|vbs3
|vbs 3
|virtualbattlespace3={{#switch:{{lc:{{{1}}}}}|img=vbs3|short=VBS3|long=Virtual Battlespace 3|#default={{{2}}}}}
|vbs:3
|vbs: 3={{#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: 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|img|Arma 2: OFP: Resistance}}</nowiki>}} produces "{{Game name|img|ArmA 2: OFP: Resistance}}"
''etc.''
''etc.''



Revision as of 07:59, 29 April 2014

Not currently in use. Awaiting peer review and feedback, before including in {{Command}} and {{Function}} to correct badly formed entries.

Eventually this should replace multiple templates, providing a simple way to organise game naming convention.

Please add any switch cases omitted, or if unsure about how to do it, leave a message on the talk page.

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

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.