Jump to content

Template:Canadian province name/doc

From Wikipedia, the free encyclopedia

This template converts the names of Canadian provinces to their two-letter codes or vice versa. This is useful because some templates ask for province names as input and others ask for province code, so one type of template could not be nested in the other without translation between the two formats.

Usage

[edit]

Use the province name in the first parameter to get the code. Put name in the second parameter to get the full province name. For example:

Input Output Output with |name Output with |link
{{CanProvName|Saskatchewan}} SK Saskatchewan SK
{{CanProvName|P.E.I.}} PE Prince Edward Island PE
{{CanProvName|Northwest Territories}} NT Northwest Territories NT
{{CanProvName|Canada}} CA Canada CA
{{CanProvName|QC}} QC Quebec QC

The previous names of Newfoundland and Labrador and the Northwest Territories can be produced as follows:

Input Output Output with |name Output with |link
{{CanProvName|NF}} NF Newfoundland NF
{{CanProvName|N-W}} NT North-West Territories NT

TemplateData

[edit]

This template converts between the full names and short form names of Canadian provinces.

Template parameters

ParameterDescriptionTypeStatus
province1

Full name or short form name of province.

Linerequired
type of output2

By default, template will output the two-letter code for the province. Set this parameter to 'name' to output the full name. Set this parameter to 'link' to make the two-letter code a wikilink.

Suggested values
name link
Lineoptional