Name – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Correcting case for TKOH and TKOM which contrary to apparently all other short names, should be upper case.)
(Greatly extended range of possible misconfigured inputs to handle. Added 3rd type of output. >> Unsure of correct "Zeus" convention(s) <<)
Line 1: Line 1:
<includeonly>{{#if:{{{short|}}}|{{#switch:{{lc:{{{short}}}}}
<includeonly>{{#switch:{{lc:{{{2}}}}}
|bi
|bis
|bohemia interactive studio
|bohemia interactive studios={{#switch:{{lc:{{{1}}}}}|img=bi|short=BI|long=Bohemia Interactive|#default={{{2}}}}}
|aiv
|armaaiv
|arma aiv
|arma2aiv
|arma2 aiv
|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=arma
|arma 1={{#switch:{{lc:{{{1}}}}}|img=arma|short=Arma|long=Armed Assault|#default={{{2}}}}}
|arma2
|arma2
|arma 2=arma2
|arma 2={{#switch:{{lc:{{{1}}}}}|img=arma2|short=Arma 2|long=Arma 2|#default={{{2}}}}}
|oa
|armaoa
|arma oa
|arma:oa
|arma: oa
|arma2oa
|arma2oa
|arma2 oa
|arma 2oa
|arma 2oa
|arma2 oa
|arma 2 oa
|arma 2 oa
|arma2:oa
|arma2:oa
|arma 2:oa
|arma2: oa
|arma2: oa
|arma 2: oa=arma2oa
|arma3
|arma 3=arma3
|ofp=ofp
|ofpe
|ofp e
|ofp:e
|ofp: e=ofpe
|ofpr
|ofp r
|ofp:r
|ofp: r=ofpr
|vbs1
|vbs 1=vbs1
|vbs2
|vbs 2=vbs2
|tkoh
|toh=TKOH
|tkom
|tom=TKOM
|#default=arma}}|{{#if:{{{long|}}}|{{#switch:{{lc:{{{long}}}}}
|arma
|arma1
|arma 1=Armed Assault
|arma2
|arma 2=Arma 2
|arma2oa
|arma 2oa
|arma2 oa
|arma 2 oa
|arma2:oa
|arma 2:oa
|arma 2:oa
|arma2: oa
|arma 2: oa={{#switch:{{lc:{{{1}}}}}|img=arma2oa|short=Arma 2:OA|long=Arma 2: Operation Arrowhead|#default={{{2}}}}}
|arma 2: oa=Arma 2: Operation Arrowhead
|baf
|armabaf
|arma baf
|arma:baf
|arma: baf
|arma2baf
|arma2 baf
|arma 2baf
|arma 2 baf
|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
|armapmc
|arma pmc
|arma:pmc
|arma: pmc
|arma2pmc
|arma2 pmc
|arma 2pmc
|arma 2 pmc
|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
|armaarc
|arma arc
|arma:arc
|arma: arc
|arma2arc
|arma2 arc
|arma 2arc
|arma 2 arc
|arma2:arc
|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
|arma3
|arma 3=Arma 3
|arma 3={{#switch:{{lc:{{{1}}}}}|img=arma3|short=Arma 3|long=Arma 3|#default={{{2}}}}}
|ofp=Operation Flashpoint
|zeus
|arma zeus
|arma3 zeus
|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
|armaofp
|arma ofp
|arma:ofp
|arma: ofp
|arma2ofp
|arma2 ofp
|arma 2ofp
|arma 2 ofp
|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
|ofp:e
|ofp: e=Operation Flashpoint: Elite
|ofp: e
|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
|arma2 ofpe
|arma2:ofpe
|arma2: ofpe
|arma2 ofp e
|arma2: ofp e
|arma2:ofp:e
|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
|ofp:r
|ofp: r=Operation Flashpoint: Resistance
|ofp: r
|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
|arma2 ofpr
|arma2:ofpr
|arma2: ofpr
|arma2 ofp r
|arma2: ofp r
|arma2:ofp:r
|arma2:ofp: r
|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=Virtual Battlespace 1
|vbs 1
|vbs:1
|vbs: 1={{#switch:{{lc:{{{1}}}}}|img=vbs1|short=VBS1|long=Virtual Battlespace 1|#default={{{2}}}}}
|vbs2
|vbs2
|vbs 2=Virtual Battlespace 2
|vbs 2
|vbs:2
|vbs: 2={{#switch:{{lc:{{{1}}}}}|img=vbs2|short=VBS2|long=Virtual Battlespace 2|#default={{{2}}}}}
|vbs3
|vbs 3
|vbs:3
|vbs: 3={{#switch:{{lc:{{{1}}}}}|img=vbs3|short=VBS3|long=Virtual Battlespace 3|#default={{{2}}}}}
|tkoh
|tkoh
|toh=Take On Helicopters
|toh={{#switch:{{lc:{{{1}}}}}|img=TKOH|short=TKOH|long=Take On Helicopters|#default={{{2}}}}}
|tkom
|tkom
|tom=Take On Mars
|tom={{#switch:{{lc:{{{1}}}}}|img=TKOM|short=TKOM|long=Take On Mars|#default={{{2}}}}}
|#default=Arma}}|}}}}</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.


Eventually this should replace multiple templates, providing a simple way to organise game naming convention.
Eventually this should replace multiple templates, providing a simple way to organise game naming convention.
Can be expanded to suit future and possible present needs, not currently included ''i.e.'' returning correctly formatted correct case short names like "''Arma 2:OA''" etc.


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 one parameter in the form of either <tt>short=name</tt>, which returns the correct short name in lower case.
;Takes two parameters
:Or
:The first parameter is the format request. Either "''img''", "''short''" or "''long''"
<tt>long=name</tt>, which returns the correct long name in correct case.
:The second parameter is the input string to be verified or corrected.
:And
Will return the input string if no matches are found.
Returns the correct game name, even if the input isn't correct.
===Examples===
*{{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|long|ArmA 2: OFP: E}}</nowiki>}} produces "{{Game name|long|Arma 2: OFP: E}}"
''etc.''


''i.e.'' {{Inline code|<nowiki>{{Game name|long=toh}}</nowiki>}} will return "{{Game name|long=toh}}" even though the input should have been "TKOH".
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.
:And
{{Inline code|<nowiki>{{Game name|short=ArmA 2: OA}}</nowiki>}} will return "{{Game name|short=ArmA 2: OA}}".


[[Category:Templates|{{uc:{{PAGENAME}} }}]]</noinclude>
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>

Revision as of 08:07, 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.