Template:Flag

From comp.tf
Revision as of 03:22, 24 April 2020 by Garlic (talk | contribs)
Jump to navigation Jump to search

(view - edit) Documentation

Template:Flag displays a flag icon.

Usage

{{flag|1}}

1

This is the only parameter in the template and is used for defining which country's flag will be shown.

  • All valid settings for flags are listed in the tables below
  • This parameter is case-insensitive.

Examples

You type You get
Full name {{flag|United Nations}}
[[Image:Flag_of_United Nations.png
United Nations|link=]]
Alternate name {{flag|world}}
[[Image:Flag_of_Unknown.png
Unknown|link=]]
Abbreviation {{flag|un}}
[[Image:Flag_of_United Nations.png
United Nations|link=]]
No parameter {{flag|}}
[[Image:Flag_of_Unknown.png
Unknown|link=]]
Invalid parameter {{flag|invalid}}
[[Image:Flag_of_Unknown.png
Unknown|link=]]

Valid settings

Note: United Kingdom flags

The individual flags of
England
England,
Northern Ireland
Northern Ireland,
Scotland
Scotland, and
Wales
Wales should take preference in all possible circumstances over the
United Kingdom
United Kingdom flag.
Misc · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z

Miscellaneous

[[Image:Flag_of_Unknown.png
Unknown|link=]] asean ASEAN
[[Image:Flag_of_English Language.png
English Language|link=]] ukus English Language
usuk
[[Image:Flag_of_Europe.png
Europe|link=]] eu Europe
European Union
[[Image:Flag_of_North America.png
North America|link=]] nam North America
[[Image:Flag_of_Oceania.png
Oceania|link=]] aunz Australasia
Oceania
Australia/New Zealand
nzau New Zealand/Australia
[[Image:Flag_of_South America.png
South America|link=]] sam South America
[[Image:Flag_of_United Nations.png
United Nations|link=]] un United Nations
Global
International
World
[[Image:Flag_of_Unknown.png
Unknown|link=]] Unknown

A

[[Image:Flag_of_Afghanistan.png
Afghanistan|link=]] af Afghanistan
[[Image:Flag_of_Albania.png
Albania|link=]] al Albania
[[Image:Flag_of_Algeria.png
Algeria|link=]] dz Algeria
[[Image:Flag_of_Andorra.png
Andorra|link=]] ad Andorra
[[Image:Flag_of_Angola.png
Angola|link=]] ao Angola
[[Image:Flag_of_Antigua and Barbuda.png
Antigua and Barbuda|link=]] ag Antigua and Barbuda
[[Image:Flag_of_Argentina.png
Argentina|link=]] ar Argentina
[[Image:Flag_of_Armenia.png
Armenia|link=]] am Armenia
[[Image:Flag_of_Australia.png
Australia|link=]] au Australia
[[Image:Flag_of_Austria.png
Austria|link=]] at Austria
[[Image:Flag_of_Azerbaijan.png
Azerbaijan|link=]] az Azerbaijan

B

[[Image:Flag_of_The Bahamas.png
The Bahamas|link=]] bs Bahamas
The Bahamas
[[Image:Flag_of_Bahrain.png
Bahrain|link=]] bh Bahrain
[[Image:Flag_of_Bangladesh.png
Bangladesh|link=]] bd Bangladesh
[[Image:Flag_of_Barbados.png
Barbados|link=]] bb Barbados
[[Image:Flag_of_Belarus.png
Belarus|link=]] by Belarus
[[Image:Flag_of_Belgium.png
Belgium|link=]] be Belgium
[[Image:Flag_of_Belize.png
Belize|link=]] bz Belize
[[Image:Flag_of_Benin.png
Benin|link=]] bj Benin
[[Image:Flag_of_Bhutan.png
Bhutan|link=]] bt Bhutan
[[Image:Flag_of_Bolivia.png
Bolivia|link=]] bo Bolivia
[[Image:Flag_of_Bosnia and Herzegovina.png
Bosnia and Herzegovina|link=]] ba Bosnia and Herzegovina
[[Image:Flag_of_Botswana.png
Botswana|link=]] bw Botswana
[[Image:Flag_of_Brazil.png
Brazil|link=]] br Brazil
[[Image:Flag_of_Brunei.png
Brunei|link=]] bn Brunei
[[Image:Flag_of_Bulgaria.png
Bulgaria|link=]] bg Bulgaria
[[Image:Flag_of_Burkina Faso.png
Burkina Faso|link=]] bf Burkina Faso
[[Image:Flag_of_Burundi.png
Burundi|link=]] bi Burundi

C

[[Image:Flag_of_Cambodia.png
Cambodia|link=]] kh Cambodia
[[Image:Flag_of_Cameroon.png
Cameroon|link=]] cm Cameroon
[[Image:Flag_of_Canada.png
Canada|link=]] ca Canada
[[Image:Flag_of_Cape Verde.png
Cape Verde|link=]] cv Cape Verde
Cabo Verde
[[Image:Flag_of_Central African Republic.png
Central African Republic|link=]] cf Central African
Republic
[[Image:Flag_of_Chad.png
Chad|link=]] td Chad
[[Image:Flag_of_Chile.png
Chile|link=]] cl Chile
[[Image:Flag_of_China.png
China|link=]] cn China
[[Image:Flag_of_Colombia.png
Colombia|link=]] co Colombia
[[Image:Flag_of_Comoros.png
Comoros|link=]] km Comoros
[[Image:Flag_of_Costa Rica.png
Costa Rica|link=]] cr Costa Rica
[[Image:Flag_of_Croatia.png
Croatia|link=]] hr Croatia
[[Image:Flag_of_Cuba.png
Cuba|link=]] cu Cuba
[[Image:Flag_of_Cyprus.png
Cyprus|link=]] cy Cyprus
[[Image:Flag_of_Czech Republic.png
Czech Republic|link=]] cz Czech Republic
Czechia
[[Image:Flag_of_Ivory Coast.png
Ivory Coast|link=]] ci Côte d'Ivoire
Ivory Coast

D

[[Image:Flag_of_Democratic Republic of the Congo.png
Democratic Republic of the Congo|link=]] cd Democratic Republic
of the Congo
Zaire
[[Image:Flag_of_Denmark.png
Denmark|link=]] dk Denmark
[[Image:Flag_of_Djibouti.png
Djibouti|link=]] dj Djibouti
[[Image:Flag_of_Dominica.png
Dominica|link=]] dm Dominica
[[Image:Flag_of_Dominican Republic.png
Dominican Republic|link=]] do Dominican Republic

E

[[Image:Flag_of_East Timor.png
East Timor|link=]] tl East Timor
Timor-Leste
[[Image:Flag_of_Ecuador.png
Ecuador|link=]] ec Ecuador
[[Image:Flag_of_Egypt.png
Egypt|link=]] eg Egypt
[[Image:Flag_of_El Salvador.png
El Salvador|link=]] sv El Salvador
[[Image:Flag_of_England.png
England|link=]] uken England
en
[[Image:Flag_of_Equatorial Guinea.png
Equatorial Guinea|link=]] gq Equatorial Guinea
[[Image:Flag_of_Eritrea.png
Eritrea|link=]] er Eritrea
[[Image:Flag_of_Estonia.png
Estonia|link=]] ee Estonia
[[Image:Flag_of_Swaziland.png
Swaziland|link=]] sz Eswatini
Swaziland
[[Image:Flag_of_Ethiopia.png
Ethiopia|link=]] et Ethiopia

F

[[Image:Flag_of_Fiji.png
Fiji|link=]] fj Fiji
[[Image:Flag_of_Finland.png
Finland|link=]] fi Finland
[[Image:Flag_of_France.png
France|link=]] fr France

G

[[Image:Flag_of_Gabon.png
Gabon|link=]] ga Gabon
[[Image:Flag_of_Gambia.png
Gambia|link=]] gm The Gambia
Gambia
[[Image:Flag_of_Georgia.png
Georgia|link=]] ge Georgia
[[Image:Flag_of_Germany.png
Germany|link=]] de Germany
[[Image:Flag_of_Ghana.png
Ghana|link=]] gh Ghana
[[Image:Flag_of_Greece.png
Greece|link=]] gr Greece
[[Image:Flag_of_Greenland.png
Greenland|link=]] gl Greenland
[[Image:Flag_of_Grenada.png
Grenada|link=]] gd Grenada
[[Image:Flag_of_Guatemala.png
Guatemala|link=]] gt Guatemala
[[Image:Flag_of_Guinea.png
Guinea|link=]] gn Guinea
[[Image:Flag_of_Guinea-Bissau.png
Guinea-Bissau|link=]] gw Guinea-Bissau
[[Image:Flag_of_Guyana.png
Guyana|link=]] gy Guyana

H

[[Image:Flag_of_Haiti.png
Haiti|link=]] ht Haiti
[[Image:Flag_of_Honduras.png
Honduras|link=]] hn Honduras
[[Image:Flag_of_Hong Kong.png
Hong Kong|link=]] hk Hong Kong
[[Image:Flag_of_Hungary.png
Hungary|link=]] hu Hungary

I

[[Image:Flag_of_Iceland.png
Iceland|link=]] is Iceland
[[Image:Flag_of_India.png
India|link=]] in India
[[Image:Flag_of_Indonesia.png
Indonesia|link=]] id Indonesia
[[Image:Flag_of_Iran.png
Iran|link=]] ir Iran
[[Image:Flag_of_Iraq.png
Iraq|link=]] iq Iraq
[[Image:Flag_of_Ireland.png
Ireland|link=]] ie Ireland
[[Image:Flag_of_Israel.png
Israel|link=]] il Israel
[[Image:Flag_of_Italy.png
Italy|link=]] it Italy

J

[[Image:Flag_of_Jamaica.png
Jamaica|link=]] jm Jamaica
[[Image:Flag_of_Japan.png
Japan|link=]] jp Japan
[[Image:Flag_of_Jordan.png
Jordan|link=]] jo Jordan

K

[[Image:Flag_of_Kazakhstan.png
Kazakhstan|link=]] kz Kazakhstan
[[Image:Flag_of_Kenya.png
Kenya|link=]] ke Kenya
[[Image:Flag_of_Kiribati.png
Kiribati|link=]] ki Kiribati
[[Image:Flag_of_Kosovo.png
Kosovo|link=]] xk Kosovo
[[Image:Flag_of_Kuwait.png
Kuwait|link=]] kw Kuwait
[[Image:Flag_of_Kyrgyzstan.png
Kyrgyzstan|link=]] kg Kyrgyzstan

L

[[Image:Flag_of_Laos.png
Laos|link=]] la Laos
[[Image:Flag_of_Latvia.png
Latvia|link=]] lv Latvia
[[Image:Flag_of_Lebanon.png
Lebanon|link=]] lb Lebanon
[[Image:Flag_of_Lesotho.png
Lesotho|link=]] ls Lesotho
[[Image:Flag_of_Liberia.png
Liberia|link=]] lr Liberia
[[Image:Flag_of_Libya.png
Libya|link=]] ly Libya
[[Image:Flag_of_Liechtenstein.png
Liechtenstein|link=]] li Liechtenstein
[[Image:Flag_of_Lithuania.png
Lithuania|link=]] lt Lithuania
[[Image:Flag_of_Luxembourg.png
Luxembourg|link=]] lu Luxembourg

M

[[Image:Flag_of_Macau.png
Macau|link=]] mo Macao
Macau
[[Image:Flag_of_Madagascar.png
Madagascar|link=]] mg Madagascar
[[Image:Flag_of_Malawi.png
Malawi|link=]] mw Malawi
[[Image:Flag_of_Malaysia.png
Malaysia|link=]] my Malaysia
[[Image:Flag_of_Maldives.png
Maldives|link=]] mv Maldives
[[Image:Flag_of_Mali.png
Mali|link=]] ml Mali
[[Image:Flag_of_Malta.png
Malta|link=]] mt Malta
[[Image:Flag_of_Marshall Islands.png
Marshall Islands|link=]] mh Marshall Islands
[[Image:Flag_of_Mauritania.png
Mauritania|link=]] mr Mauritania
[[Image:Flag_of_Mauritius.png
Mauritius|link=]] mu Mauritius
[[Image:Flag_of_Mexico.png
Mexico|link=]] mx Mexico
[[Image:Flag_of_Micronesia.png
Micronesia|link=]] fm Micronesia
[[Image:Flag_of_Moldova.png
Moldova|link=]] md Moldova
[[Image:Flag_of_Monaco.png
Monaco|link=]] mc Monaco
[[Image:Flag_of_Mongolia.png
Mongolia|link=]] mn Mongolia
[[Image:Flag_of_Montenegro.png
Montenegro|link=]] me Montenegro
[[Image:Flag_of_Morocco.png
Morocco|link=]] ma Morocco
[[Image:Flag_of_Mozambique.png
Mozambique|link=]] mz Mozambique
[[Image:Flag_of_Myanmar.png
Myanmar|link=]] mm Myanmar

N

[[Image:Flag_of_Namibia.png
Namibia|link=]] na Namibia
[[Image:Flag_of_Nauru.png
Nauru|link=]] nr Nauru
[[Image:Flag_of_Nepal.png
Nepal|link=]] np Nepal
[[Image:Flag_of_Netherlands.png
Netherlands|link=]] nl Netherlands
Holland
[[Image:Flag_of_New Zealand.png
New Zealand|link=]] nz New Zealand
[[Image:Flag_of_Nicaragua.png
Nicaragua|link=]] ni Nicaragua
[[Image:Flag_of_Niger.png
Niger|link=]] ne Niger
[[Image:Flag_of_Nigeria.png
Nigeria|link=]] ng Nigeria
[[Image:Flag_of_North Korea.png
North Korea|link=]] kp North Korea
[[Image:Flag_of_Macedonia.png
Macedonia|link=]] mk Macedonia
North Macedonia
[[Image:Flag_of_Northern Ireland.png
Northern Ireland|link=]] ukni Northern Ireland
[[Image:Flag_of_Norway.png
Norway|link=]] no Norway

O

[[Image:Flag_of_Oman.png
Oman|link=]] om Oman

P

[[Image:Flag_of_Pakistan.png
Pakistan|link=]] pk Pakistan
[[Image:Flag_of_Palau.png
Palau|link=]] pw Palau
[[Image:Flag_of_Palestine.png
Palestine|link=]] ps Palestine
[[Image:Flag_of_Panama.png
Panama|link=]] pa Panama
[[Image:Flag_of_Papua New Guinea.png
Papua New Guinea|link=]] pg Papua New Guinea
[[Image:Flag_of_Paraguay.png
Paraguay|link=]] py Paraguay
[[Image:Flag_of_Peru.png
Peru|link=]] pe Peru
[[Image:Flag_of_Philippines.png
Philippines|link=]] ph Philippines
[[Image:Flag_of_Poland.png
Poland|link=]] pl Poland
[[Image:Flag_of_Portugal.png
Portugal|link=]] pt Portugal
[[Image:Flag_of_Puerto Rico.png
Puerto Rico|link=]] pr Puerto Rico

Q

[[Image:Flag_of_Qatar.png
Qatar|link=]] qa Qatar

R

[[Image:Flag_of_Republic of the Congo.png
Republic of the Congo|link=]] cg Republic of the Congo
Congo
[[Image:Flag_of_Romania.png
Romania|link=]] ro Romania
[[Image:Flag_of_Russia.png
Russia|link=]] ru Russia
[[Image:Flag_of_Rwanda.png
Rwanda|link=]] rw Rwanda

S

[[Image:Flag_of_Saint Kitts and Nevis.png
Saint Kitts and Nevis|link=]] kn Saint Kitts and Nevis
[[Image:Flag_of_Saint Lucia.png
Saint Lucia|link=]] lc Saint Lucia
[[Image:Flag_of_Saint Vincent and the Grenadines.png
Saint Vincent and the Grenadines|link=]] vc Saint Vincent
and the Grenadines
[[Image:Flag_of_Samoa.png
Samoa|link=]] ws Samoa
[[Image:Flag_of_San Marino.png
San Marino|link=]] sm San Marino
[[Image:Flag_of_Sao Tome and Principe.png
Sao Tome and Principe|link=]] st Sao Tome and Principe
[[Image:Flag_of_Saudi Arabia.png
Saudi Arabia|link=]] sa Saudi Arabia
[[Image:Flag_of_Scotland.png
Scotland|link=]] uksc Scotland
[[Image:Flag_of_Senegal.png
Senegal|link=]] sn Senegal
[[Image:Flag_of_Serbia.png
Serbia|link=]] rs Serbia
[[Image:Flag_of_Seychelles.png
Seychelles|link=]] sc Seychelles
[[Image:Flag_of_Sierra Leone.png
Sierra Leone|link=]] sl Sierra Leone
[[Image:Flag_of_Singapore.png
Singapore|link=]] sg Singapore
[[Image:Flag_of_Slovakia.png
Slovakia|link=]] sk Slovakia
[[Image:Flag_of_Slovenia.png
Slovenia|link=]] si Slovenia
[[Image:Flag_of_Solomon Islands.png
Solomon Islands|link=]] sb Soloman Islands
[[Image:Flag_of_Somalia.png
Somalia|link=]] so Somalia
[[Image:Flag_of_South Africa.png
South Africa|link=]] za South Africa
rsa
[[Image:Flag_of_South Korea.png
South Korea|link=]] kr South Korea
[[Image:Flag_of_South Sudan.png
South Sudan|link=]] ss South Sudan
[[Image:Flag_of_Spain.png
Spain|link=]] es Spain
[[Image:Flag_of_Sri Lanka.png
Sri Lanka|link=]] lk Sri Lanka
[[Image:Flag_of_Sudan.png
Sudan|link=]] sd Sudan
[[Image:Flag_of_Suriname.png
Suriname|link=]] sr Suriname
[[Image:Flag_of_Sweden.png
Sweden|link=]] se Sweden
[[Image:Flag_of_Switzerland.png
Switzerland|link=]] ch Switzerland
[[Image:Flag_of_Syria.png
Syria|link=]] sy Syria

T

[[Image:Flag_of_Taiwan.png
Taiwan|link=]] tw Taiwan
[[Image:Flag_of_Tajikistan.png
Tajikistan|link=]] tj Tajikistan
[[Image:Flag_of_Tanzania.png
Tanzania|link=]] tz Tanzania
[[Image:Flag_of_Thailand.png
Thailand|link=]] th Thailand
[[Image:Flag_of_Togo.png
Togo|link=]] tg Togo
[[Image:Flag_of_Tonga.png
Tonga|link=]] to Tonga
[[Image:Flag_of_Trinidad and Tobago.png
Trinidad and Tobago|link=]] tt Trinidad and Tobago
[[Image:Flag_of_Tunisia.png
Tunisia|link=]] tn Tunisia
[[Image:Flag_of_Turkey.png
Turkey|link=]] tr Turkey
[[Image:Flag_of_Turkmenistan.png
Turkmenistan|link=]] tm Turkmenistan
[[Image:Flag_of_Tuvalu.png
Tuvalu|link=]] tv Tuvalu

U

[[Image:Flag_of_Uganda.png
Uganda|link=]] ug Uganda
[[Image:Flag_of_Ukraine.png
Ukraine|link=]] ua Ukraine
[[Image:Flag_of_United Arab Emirates.png
United Arab Emirates|link=]] ae United Arab Emirates
uae
[[Image:Flag_of_United Kingdom.png
United Kingdom|link=]] uk United Kingdom
gb Britain
Great Britain
[[Image:Flag_of_United States.png
United States|link=]] us United States
usa United States of America
[[Image:Flag_of_Uruguay.png
Uruguay|link=]] uy Uruguay
[[Image:Flag_of_Uzbekistan.png
Uzbekistan|link=]] uz Uzbekistan

V

[[Image:Flag_of_Vanuatu.png
Vanuatu|link=]] vu Vanuatu
[[Image:Flag_of_Vatican City.png
Vatican City|link=]] va Vatican City
[[Image:Flag_of_Venezuela.png
Venezuela|link=]] ve Venezuela
[[Image:Flag_of_Vietnam.png
Vietnam|link=]] vn Vietnam

W

[[Image:Flag_of_Wales.png
Wales|link=]] wa Wales
ukwa

X

Y

[[Image:Flag_of_Yemen.png
Yemen|link=]] ye Yemen

Z

[[Image:Flag_of_Zambia.png
Zambia|link=]] zm Zambia
[[Image:Flag_of_Zimbabwe.png
Zimbabwe|link=]] zw Zimbabwe

Developer documentation

How this template works

  1. Template:Flag takes the input parameter and calls a sub-template at "Template:Flag/X". For example, {{flag|united nations}} will call Template:Flag/united nations.
  2. This sub-template then in turn calls Template:Flag icon, supplying it with a single parameter ({{Flag icon|X}}). For example, Template:Flag/united nations supplies Template:Flag icon with the single parameter United Nations
  3. Template:Flag icon calls for a flag image at "File:Flag of X.png", and applies formatting such as sizing and a 1px border. For example, if Template:Flag icon is given the parameter United Nations, it will supply File:Flag of United Nations.png (
    United Nations
    ).

How to add a flag

If you wish to add a flag, the following requirements must be followed:

Image size

  • Width: equal or less than 23px
  • Height: equal or less than 15px
  • Aspect ratio: retained from source flag
If your flag is a custom flag (e.g.
North America
), we recommend a 23x15px flag which has a 2:3 ratio.

Upload

  • Your flag should be uploaded to File:Flag of ProperFlagName.png, where ProperFlagName is the full name of your flag with correct capitalization
  • Make sure you add your flag image to Category:Flag Images.

Update templates

  • Create a template at Template:Flag/lowercaseflagname, where lowercaseflagname is the full name of your flag in complete lowercase. This template should contain the code below:
{{Flag icon|'''ProperFlagName'''}}<noinclude>[[Category:Flag sub-templates]]</noinclude>
  • Create a template at Template:Flag/abbr, where abbr is the lowercase abbreviation of your flag. This template should be a simple redirect to the primary sub-template (Template:Flag/lowercaseflagname)
    • If your template has any alternate names or abbreviations, create them as simple redirects to the primary sub-template as well
  • Add your flag to the correct table in the documentation template.