Module:Country label/doc
Usage
Returns a single metadata value for a country or region. Data is sourced from Module:Country label/data, which is generated from Template:Country label and its sub-templates.
main
| Parameter | Description | Example |
|---|---|---|
country | Country or region name, must match exactly | Germany |
parameter | Metadata key to retrieve | cont1 |
default | Value to return if country or parameter is not found | unknown |
Common parameters
| Key | Description | Example values |
|---|---|---|
type | Entity type | country, constituent, region, continent, city |
status | Current or historical | current, former |
cont1, cont2, cont3 | Continent(s) | Europe, Asia |
partof | Parent country or region | Germany |
partofindex | Type of subdivision | state, province, region |
q | Wikidata item ID | Q183 |
art | Article prefix ("the") if applicable | the |
flag | Flag filename on Commons | Flag of Germany.svg |
Examples
{{#invoke:Country label|main|country=Germany|parameter=cont1}}
{{#invoke:Country label|main|Germany|cont1}}
→ Europe
{{#invoke:Country label|main|country=Ancient Rome|parameter=status}}
{{#invoke:Country label|main|Ancient Rome|status}}
→ former
{{#invoke:Country label|main|country=Bavaria|parameter=partof}}
{{#invoke:Country label|main|Bavaria|partof}}
→ Germany
{{#invoke:Country label|main|country=Atlantis|parameter=cont1|default=unknown}}
{{#invoke:Country label|main|Atlantis|cont1|unknown}}
→ unknown
Lua API
For use in other Lua modules (not via #invoke).
_withArticle(country)
Returns the country name prefixed with its article if applicable (e.g. the United Kingdom). Uses the cat alias as the display name when present. Falls back to the plain country name if no article is defined.
local CountryLabel = require('Module:Country label')
CountryLabel._withArticle('United Kingdom') -- "the United Kingdom"
CountryLabel._withArticle('Germany') -- "Germany"