Template:FlagCharLink/doc
Usage
(Near) Drop-in replacement for {{Flagicon}} using Module:Char to create emoji flags. It takes the same arguments as {{Flagicon}}, except you need to replace the country's name by the flag's ISO sequence as first argument, and the second one (page title) is mandatory.
This method nets you all the benefits of using Module:Char instead of {{Flagicon}}: better accessibility, lessened impact on page loading time, and mitigates a bug that can cause the page not to load [1], at the cost of flag library being imcomplete.
Be sure to check whether an emoji flag for the country you want to display exists. Otherwise, use {{Flagicon}}.
Parameters
- First parameter (mandatory): ISO 3166-1 alpha-2 country code, or another emoji flag sequence to create the flag.
- Second parameter (mandatory): link to the target page of the country or territory. Also used as the (auto-translated) country name to display.
- 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=1is used.
- The optional third parameter will not be used if
Examples
{{FlagCharLink|US|United States}} : 🇺🇸 United States
{{FlagCharLink|US|United States|United States of America}} : 🇺🇸 United States of America
{{FlagCharLink|US|Category:United States|Category for the United States of America}} : 🇺🇸 Category for the United States of America
{{FlagCharLink|US|United States|lang= fr }} : 🇺🇸 États-Unis
{{FlagCharLink|US|United States|notext= 1 }} : 🇺🇸
The 🇺🇸 United States of America (USA), also known as the 🇺🇸 United States (U.S.) or America, is a country primarily located in North America. It is a federal republic of 50 states and a federal capital district, Washington, D.C.
See also
- {{Flag char}}
- {{Flagicon}} - More universal, but slower and less accessible equivalent.
- {{CountryNameLang}} – for translating country/territory names (including the preposition "of", possibly with a genitive or locative case and a suitable article)