Template:Flagicon/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

Usage

To display the flag of a country or territory along with its name linked to a relevant page:

  • First parameter (mandatory): name of the country for the flag icon itself, also used by default as the target page name to link, and the (auto-translated) country name to display.
    Some flag icons use a leading article which must be specified here, even if it is not displayed in the link, so in that case you must specify the following optional parameters. Note that some leading "the" articles needed in image names can be inferred for known country names.
    The name should be in English only, because this template assumes the following file name: File:Flag of (the) name.svg.
    The actual images can be borrowed in this wiki from Wikimedia Commons (see for example w:c:Category:SVG sovereign state flags for national flags, or w:c:Category:SVG flags of dependent territories for flags of dependent territories) where they are normally stored with their description page.
  • Second parameter (optional): alternative name for the link to the target page of the country or territory.
    Otherwise use the same name as set in the first parameter, and translate it automatically according to the language selected.
    May be needed to show a completely different place name that has no icon by itself but reuses the same flag of a parent country or territory (specified in the first parameter), or if you want to link to a specific project page related to that country or territory.
    The link will use automatically the page for the appropriate language (if the target page has available translations) and should not include any language code prefix, but it may specify a namespace prefix (such as "Category:").
  • Third parameter (optional): alternative name to display for the country or territory (may be needed for formatting, or for additional precisions to display).
    Otherwise use the same name as set in the second parameter, or in the first parameter if the second parameter is not set.
    This parameter may contain formatting options (but not links), and may need to be numbered explicitly if the specified value includes an equal sign (see the second example below).
  • lang=code (optional): used to translate the country or territory name given in the mandatory first parameter, when the optional second parameter is not set.
    If this optional language code is not specified, the language of the current page will be used, as determined by {{Langcode}}).
  • notext=1 (optional): if set to a non-empty value, removes the displayed text and link, just shows the flag icon with its link to the page for the country or territory.
    The optional third parameter will not be used if notext=1 is used.

Examples

See also

  • {{Flag char}} – plain text alternative that does not impact page loading time
  • {{CountryNameLang}} – for translating country/territory names (including the preposition "of", possibly with a genitive or locative case and a suitable article)