Template:Country/doc: Difference between revisions
More actions
explaining ISO code |
fix docs so the examples display and work correctly (and warn users about issue that was making them not work); other minor copyediting |
||
| Line 1: | Line 1: | ||
{{TemplateBox | {{TemplateBox | ||
|1=1 | |1=1 | ||
|1d=ISO code for country, | |1d=ISO code for country (e.g., EE = Estonia — for a list see [[:en:ISO 3166-1 alpha-2]]) | ||
|1def= | |1def= | ||
|1stat=required | |1stat=required | ||
|2=lang | |2=lang | ||
|2d=language code | |2d=language code (must be entirely lowercase) | ||
|2def= | |2def= | ||
|2stat=optional- | |2stat=optional- | ||
| Line 16: | Line 16: | ||
|name=Country | |name=Country | ||
|desc=Given the [[:en:ISO 3166-1 alpha-2|ISO code]], it checks if the English language name of the country matches a template name ( | |desc=Given the [[:en:ISO 3166-1 alpha-2|ISO code]] for a country, it checks if the English language name of the country matches a template name (e.g., EE → {{tl|Estonia}}). If such a template exists, it calls that template, if not, it returns the English name. The individual country templates provide localization of country names, and link the localized name to the Wikipedia entry in the relevant language (e.g., {{tl|Estonia}} produces: {{Estonia}}). | ||
|namespace=all | |namespace=all | ||
|usergroup=all | |usergroup=all | ||
| Line 34: | Line 34: | ||
== Examples == | == Examples == | ||
*"Estonia" in current language: {{tlx|Country|EE}} gives "{{Country|EE}}" | *"Estonia" in current language: {{tlx|Country|EE}} gives "{{Country|EE}}" | ||
*"Italy" in Polish: {{tlx|Country|IT|lang= | *"Italy" in Polish: {{tlx|Country|IT|3=lang=pl}} gives "{{Country|IT|lang=pl}}" | ||
*"Ukraine" in Ukrainian without link: {{tlx|Country|UA|3=lang= | *"Ukraine" in Ukrainian without link: {{tlx|Country|UA|3=lang=uk|4=nolink=1}} gives "{{Country|UA|lang=uk|nolink=1}}" | ||
Revision as of 03:47, 20 June 2018
Given the ISO code for a country, it checks if the English language name of the country matches a template name (e.g., EE → {{Estonia}}). If such a template exists, it calls that template, if not, it returns the English name. The individual country templates provide localization of country names, and link the localized name to the Wikipedia entry in the relevant language (e.g., {{Estonia}} produces: Template:Estonia).
Usage
{{Country |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | ISO code for country (e.g., EE = Estonia — for a list see en:ISO 3166-1 alpha-2) | empty | required | |
lang | language code (must be entirely lowercase) | empty | optional | |
nolink | set to suppress hyperlink | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
See also
{{CountryName}} - which provides just the country name, without linking anywhere
Localization
This template is not intended to be localized.