کينډۍ:ConvertAbbrev/ISO 3166-2/US

Documentation icon کينډۍ لاسوند[کتل] [سمول] [پېښليک] [حافظه سپينول]

This template is used to convert commonly abbreviated things such as countries, states, provinces, and even language codes to and from their abbreviations. A hierarchical tree of subtemplates allows this template to convert virtually anything, which is really good for use in a backdoor template. If you have the word "California", but the template you're trying to use will only recognize "CA", use this to convert it!

How to use the template

سمول

Syntax: {{ConvertAbbrev|datatype|specification|value|force=abbr or long}}

This template consists of a "tree" of subtemplates containing databases of abbreviations. Each successive parameter in the code input tells the template which database to query. The datatype parameter is the most broad and tells the template what type of information you are looking for (i.e. Countries, states, or languages). The specification parameter refines the search. For example, if the datatype parameter is "ISO 3166-1", that tells the template to look for a subtype (alpha2, alpha3, or numeric). If the datatype parameter is "ISO 3166-2", the template will look for a specific country (Canada, Mexico, United States, etc.). If the datatype parameter is "ISO 639-1", the template looks for the name of a language (English, Spanish, Zulu, etc.). The value parameter is the actual name or abbreviation the user wishes to convert.

The force parameter overrides the normal nature of the conversion and forces an abbreviation or a long word to be returned. This is useful when a user may input either an abbreviation or a full name, but the template in question can only accept one of them.

If the ISO codes are a little hard to remember, there are also shortcuts:

  • {{ConvertAbbrev|ISO 3166-1|alpha-2|__country__}} can also be called by
    • {{ConvertAbbrev|Countries|alpha-2|__country__}} or
    • {{ConvertAbbrev|Countries|__country__}}.
      Note: The default for country abbreviations is alpha-2. For alpha-3 and numeric abbreviations, the user must specify the type in the specification parameter.
  • {{ConvertAbbrev|ISO 3166-2|CA|__province__}} can also be called by
  • {{ConvertAbbrev|ISO 639-1|__language__}} can also be called by
    • {{ConvertAbbrev|Languages|-1|__language__}} or
    • {{ConvertAbbrev|Languages|__language__}}.
      Note: The default for language abbreviations is ISO 639-1. For ISO 639-2 abbreviations, the user must specify the type in the specification parameter.
  • {{ConvertAbbrev|ISO 639-2|__language__}} can also be called by

Supported datasets

سمول
Countries supported in ISO 3166-2:
     Supported
     Not yet supported
     Does not exist in ISO 3166-2

Usage Examples

سمول
From Name to Abbreviation
Code Returns
{{ConvertAbbrev|ISO 3166-1|alpha-2|United Kingdom}} کينډۍ:ConvertAbbrev/ISO 3166-1/alpha-2
{{ConvertAbbrev|Countries|alpha-3|United States}} کينډۍ:ConvertAbbrev/ISO 3166-1/alpha-3
{{ConvertAbbrev|ISO 3166-2|CA|Alberta}} کينډۍ:ConvertAbbrev/ISO 3166-2/CA
{{ConvertAbbrev|Countries|Mexico|Federal District}} کينډۍ:ConvertAbbrev/ISO 3166-2/MX
{{ConvertAbbrev|ISO 639-1|Russian}} کينډۍ:ConvertAbbrev/ISO 639-1
{{ConvertAbbrev|Languages|Chinese}} کينډۍ:ConvertAbbrev/ISO 639-1
From Abbreviation to Name
Code Returns
{{ConvertAbbrev|ISO 3166-1|alpha-2|GB}} کينډۍ:ConvertAbbrev/ISO 3166-1/alpha-2
{{ConvertAbbrev|Countries|alpha-3|USA}} کينډۍ:ConvertAbbrev/ISO 3166-1/alpha-3
{{ConvertAbbrev|ISO 3166-2|CA|AB}} کينډۍ:ConvertAbbrev/ISO 3166-2/CA
{{ConvertAbbrev|Countries|Mexico|DF}} کينډۍ:ConvertAbbrev/ISO 3166-2/MX
{{ConvertAbbrev|ISO 639-1|ru}} کينډۍ:ConvertAbbrev/ISO 639-1
{{ConvertAbbrev|Languages|zh}} کينډۍ:ConvertAbbrev/ISO 639-1

Sub-pages

سمول

For a list of all the sub-pages of this template, see: Special:PrefixIndex/Template:ConvertAbbrev