This is a documentation subpage for Template:Canadian province name. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on approximately 17,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
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
editUse 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
editThis template converts between the full names and short form names of Canadian provinces.
Parameter | Description | Type | Status | |
---|---|---|---|---|
province | 1 | Full name or short form name of province. | Line | required |
type of output | 2 | 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.
| Line | optional |