Template:Country/doc: Difference between revisions
Template page
More actions
+example |
Fix language-code links to use Wikipedia interwiki prefixes |
||
| (13 intermediate revisions by 8 users not shown) | |||
| 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 [[w:ISO 3166-1 alpha-2]]) | ||
|1def= | |1def= | ||
|1stat=required | |1stat=required | ||
|2=lang | |||
|2d=language code (must be entirely lowercase) | |||
|2def= | |||
|2stat=optional- | |||
|3=nolink | |||
|3d=set to suppress hyperlink | |||
|3def= | |||
|3stat=optional- | |||
|name=Country | |name=Country | ||
|desc=Given the | |desc=Given the [[w:ISO 3166-1 alpha-2|ISO code]] for a country, it checks if the English language name of the country matches a template name. If such a template exists, it calls that template; if not, it returns the English name. | ||
|namespace=all | |namespace=all | ||
|usergroup=all | |usergroup=all | ||
| Line 14: | Line 25: | ||
|i18n-method=- | |i18n-method=- | ||
|i18n-desc= | |i18n-desc= | ||
|seealso={{tl|CountryName}} | |seealso={{tl|CountryName}}, which provides just the country name without linking it | ||
|setscats= | |setscats= | ||
|lines= | |lines= | ||
| Line 20: | Line 31: | ||
|relieson= | |relieson= | ||
}} | }} | ||
== Examples == | |||
* "New Zealand" in Russian: {{tlc|Country|NZ|3=lang=ru}} → {{Country|NZ|lang=ru}} | |||
* "Ukraine" in Ukrainian with no wikilink: {{tlc|Country|UA|3=lang=uk|4=nolink=1}} → {{Country|UA|lang=uk|nolink=1}} | |||
Latest revision as of 18:44, 12 August 2026
Given the ISO code for a country, it checks if the English language name of the country matches a template name. If such a template exists, it calls that template; if not, it returns the English name.
Usage
{{Country |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | ISO code for country (e.g., EE = Estonia — for a list see w: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 it
Localization
This template is not intended to be localized.
Examples
- "New Zealand" in Russian:
{{Country|NZ|lang=ru}}→ New Zealand - "Ukraine" in Ukrainian with no wikilink:
{{Country|UA|lang=uk|nolink=1}}→ Ukraine