Module:Country label/doc

Category:Module documentation#Country%20label/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

ParameterDescriptionExample
countryCountry or region name, must match exactlyGermany
parameterMetadata key to retrievecont1
defaultValue to return if country or parameter is not foundunknown

Common parameters

KeyDescriptionExample values
typeEntity typecountry, constituent, region, continent, city
statusCurrent or historicalcurrent, former
cont1, cont2, cont3Continent(s)Europe, Asia
partofParent country or regionGermany
partofindexType of subdivisionstate, province, region
qWikidata item IDQ183
artArticle prefix ("the") if applicablethe
flagFlag filename on CommonsFlag 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"
Category:Module documentation