Template:Engvar/doc

This template is used inside other templates. It allows templates to show national varieties of English, when engvar is passed by each article.

For example, one template can display "football" for en-UK articles, and "soccer" for en-US articles.

Usage

 * 1) Articles specify the English variety parameter for relevant templates like . They do not use.
 * 2) Templates use . It should not forget to pass-through engvar

The defaultWord be shown by default. But if an article asks for an English variety that has a corresponding parameter specified in the template, the value will be shown.

In the example, the template specified a British English word as default whenever no engvar is specified by the article. The word can be changed in an American English article by that article specifying en-US.

Note: is unrelated to parameter names like color vs. colour. See programming option data3

Example
Consider an example template, a fictive. The demo is encoded in Engvar/doc/infobox demo.

Three articles
undefined

undefined

undefined

A live example
Currently, infobox element has five words. Phosphorus shows en-UK despite the en-US default.

Template

 * lang=wikitext}}

List of English varieties
In the template, use the exact ISO-code as the parameter name like vapour. Write soccer not soccer. Needed varieties have articles using the template and words differing from the default.

There is backwards compatibility for leeway in articles. en-US, United States, US can all show the football variety.

Maintenance category
Articles with an invalid engvar will be placed in the hidden maintenance category Category:Articles using an unknown Template:Engvar option. Articles listed may need editing.

An article's requested engvar may be unspecified in the template. For example, if an article uses but the template has no en-ZA, then the template will return default color name. The category will not be used.


 * When this categorization is not desired for a whole template, set no in the template
 * Otherwise pass-through this setting from the article: engvarCat. This allows the editor to switch categorization off per article.

Articles are sorted by engvarCatSort or by default. Note that other templates will fill this category. Set this parameter like Personal prefs in a template to group its listings under "P".

Template data
{	"params": { "defaultword": { "label": "Default spelling", "type": "string", "example": "colour", "suggested": true, "description": "The default word, usually the word in the English variety most often used" },		"defaultLang": { "label": "Default English variety", "type": "string", "example": "en-US", "suggested": true, "suggestedvalues": [ "en-US", "en-AU", "en-GB", "en-CA", "en-EI", "en-HK", "en-IN", "en-JM", "en-MW", "en-NZ", "en-NG", "en-PK", "en-PH", "en-SCO", "en-SG", "en-ZA", "en-TT", "en-OED", "en-IUPAC" ],			"description": "Adding this helps document your setting" },		"engvar": { "label": "English variety", "type": "string", "suggestedvalues": [ ""			],			"required": true },		"engvarCat": { "label": "Suppress maintenance category", "type": "string", "suggestedvalues": [ "",				"no" ],			"default": "yes", "suggested": true },		"engvarCatSort": { "label": "Maintenance category sort key", "type": "string", "default": "" },		"en-US": { "label": "American English spelling", "type": "string", "example": "color" },		"en-AU": { "label": "Australian English spelling", "type": "string" },		"en-GB": { "label": "British English spelling", "type": "string" },		"en-CA": { "label": "Canadian English spelling", "type": "string" },		"en-EI": { "label": "Hiberno-English (Irish-English) spelling", "type": "string" },		"en-HK": { "label": "Hong Kong English spelling", "type": "string" },		"en-IN": { "label": "Indian English spelling", "type": "string" },		"en-JM": { "label": "Jamaican English spelling", "type": "string" },		"en-MW": { "label": "Malawian English spelling", "type": "string" },		"en-NZ": { "label": "New Zealand English spelling", "type": "string" },		"en-NG": { "label": "Nigerian English spelling", "type": "string" },		"en-PK": { "label": "Pakistani English spelling", "type": "string" },		"en-PH": { "label": "Philippine English spelling", "type": "string" },		"en-SCO": { "label": "Scottish English spelling", "type": "string" },		"en-SG": { "label": "Singapore English spelling", "type": "string" },		"en-ZA": { "label": "South African English spelling", "type": "string" },		"en-TT": { "label": "Trinidadian English spelling", "type": "string" },		"en-OED": { "label": "British (Oxford) English spelling", "type": "string" },		"en-IUPAC": { "label": "IUPAC spelling", "type": "string" }	} }