Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Canadian province name

Permanently protected template
From Wikipedia, the free encyclopedia
Template documentation[view] [edit] [history] [purge]
WarningThis template is used onapproximately 18,000 pages and changes may be widely noticed. Test changes in the template's/sandbox or/testcases subpages, or in your ownuser subpage. Consider discussing changes on thetalk 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. Putname in the second parameter to get the full province name. For example:

InputOutputOutput with|nameOutput with|link
{{CanProvName|Saskatchewan}}SKSaskatchewanSK
{{CanProvName|P.E.I.}}PEPrince Edward IslandPE
{{CanProvName|Northwest Territories}}NTNorthwest TerritoriesNT
{{CanProvName|Canada}}CACanadaCA
{{CanProvName|QC}}QCQuebecQC

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

InputOutputOutput with|nameOutput with|link
{{CanProvName|NF}}NFNewfoundlandNF
{{CanProvName|N-W}}NTNorth-West TerritoriesNT

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
namelink
Lineoptional
The abovedocumentation istranscluded fromTemplate: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.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Canadian_province_name&oldid=1241283907"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp