Jump to content
Wikipedia The Free Encyclopedia

Template:Canadian province name

From Wikipedia, the free encyclopedia
(Redirected from Template:CanProvName)
Template documentation[view] [edit] [history] [purge]
Warning This template is used on approximately 18,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

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

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

Template parameters[Edit template data ]

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
The above documentation is transcluded from Template:Canadian province name/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.

AltStyle によって変換されたページ (->オリジナル) /