Wikipedia:WikiProject Flag Template
Templates for displaying a tiny flag image or other country information.
Country templates
The {{country|Action|CountryName}} template is used to display various information about a country.
- Suggested country code modifiers, using format 'Country_code'-'Modifier':
- Country_code is the ISO 3166-1 alpha-3 code and for the flagIOC template it is the IOC country code. A common country name is also accepted, except for the flagISO and flagIOC templates.
- Modifier is an identification of the specific flag.
- Examples:
- {{flag|USA-48}}: Template:Country data USA-48 — the 48-star flag of the United States.
- {{flag|USA-MN}}: Template:Country data USA-MN — the USA state of Minnesota.
- {{flag|Russian-SFSR}}: Template:Country data Russian-SFSR — Flag of Russia while member of USSR.
- {{flag|Brazil-imperial}}: Template:Country data Brazil-imperial — Imperial flag of Brazil.
- {{flag|Brazil-1889}}: Template:Country data Brazil-1889 — The temporary flag of Brazil for 5 days in 1889.
- Shortcuts:
- {{flagcountry}}: {{flagcountry|CountryName}}: Same as country|flagcountry.
- {{flag}}: {{flag|CountryName}}: Flag icon with text linked to country page. (implemented with country|flag) Allows optional parameters size= for image size and name= for a text label.
- {{flagicon}}: {{flagicon|CountryName}}: Same as country|flagicon.
- {{flagIOC}}: {{ISO|CountryName}}: Same as country|flagIOC.
- {{ISO|flag}}: {{ISO|flag|CountryName}}: Same as country|flagISO.
- {{ISO|code}}: {{ISO|code|CountryName}}: Produces ISO code: {{ISO|code|United States}}: Template:ISO
- country|name: {{country|name|CountryName}}: Template:Country data name — Name of country with link to article.
- country|flag: {{country|flag|CountryName}}: Flag icon with text linked to country page.
- Each CountryName is connected to a flag file, a Wikipedia article name, and text label. The flag file and text label are displayed, with a link to the Wikipedia article.
- country|flagcountry: {{country|flagcountry|CountryName}}: Flag icon with short name of country linked to article.
- country|flagicon: {{country|flagicon|CountryName}}: Flag icon alone.
- country|flagISO: {{country|flagISO|CountryName}}: Flag icon with text linked to country page; name is an ISO 3166-1 country code.
- country|flagIOC: {{country|flagIOC|CountryName}}: Flag icon with text linked to country's Olympics page; name is an International Olympic Committee country code (see List of IOC country codes).
- IOC country code usage:
- An IOC country code should be used only for general reference to that country's Olympic activities.
- At present an IOC country code will create a link to that nation's Summer Olympics page (e.g. {{flagIOC|USA}} creates a link to United States at the Summer Olympics)
- A second argument can be added to create a link to a specific Olympics page (e.g. {{flagIOC|USA|2006 Winter}} creates a link to United States at the 2006 Winter Olympics)
- Use modified country codes such as RUS-SFSR for historical references to Games where a country's reference has changed (ie, different flag).
- An IOC country code should be used only for general reference to that country's Olympic activities.
- IOC country code usage:
- All flags using these templates have a similar appearance.
- Implemented by invoking {{country|flag|CountryName}}.
- Uses sub-templates to alias various names for a country to a specific name.
- At present, all supported countries must have sub-templates. Need better incantation or create templates.
- A couple of hundred countries have to be supported, plus aliases.
- Two/three letter abbreviations for each country.
- Some countries have aliases: US, USA, United States, United States of America.
- At present, all supported countries must have sub-templates. Need better incantation or create templates.
- Displays aliased Image file name.
- Displays aliased text label (ie, "US" is aliased to "USA").
- Links label to Wikipedia article (ie, "US" is linked to United States)
- The same alias definitions are used by several of the flag templates (flag without label, flag with abbreviation, flag with country name).
- Template data array definitions, such as aliases, can be redirected to a single definition for a country.
- Uses sub-templates to alias various names for a country to a specific name.
- Aliases for smaller entities follow the pattern COUNTRY-STATE, such as US-MN for the USA state of Minnesota (MN).
Examples:
- none Template:Country data flag
- AUS Template:Country data flag
- Australia Template:Country data flag
- AUT Template:Country data flag
- Belgium Template:Country data flag
- Earth Template:Country data flag
- Greece Template:Country data flag
- US Template:Country data flag
- USA Template:Country data flag
- United States Template:Country data flag
- United States of America Template:Country data flag
Editing flag description
{{countryedit|CountryName|IOC abbreviation}}: Displays a table with links to the fields which are used by {{country}} and {{flag}} templates.
Example of {{countryedit|USA|USA|USA}}:
For a country without an ISO code or IOC code use an empty parameter (nothing after the | symbol. An ISO country code may be displayed from a lookup table.
{{countryedit|USA||}}:
Template:Countryedit Template:Countryedit
Implementation
The technology being used is called a template array: a group of templates whose names follow patterns which are used to address them. For example, the common programming array address A(1,2) can be represented as Template:array_A_1_2.
Defined template array entries appear in this list: templates starting with country_
Template arrays for these templates follow the convention: country_AliasType_alias_CountryName
- country_: prefix used by templates related to {{country}}.
- AliasType: optional indicator of type of alias.
- Types presently defined:
- (omitted): country_alias_ has the name of the Wikipedia article for the country.
- flag: country_flag_alias_ has name of country's flag image.
- flagIOC: country_flagIOC_alias_ has name of current Olympic flag image.
- flagIOC-YEAR: country_flagIOC-YEAR_alias_ has name of Olympic flag image for specified year (used for historical references to a specific Olympic Games).
- label: country_label_alias_ has a short text label (generally an ISO three-letter abbreviation).
- flag_ISO: country_flag_ISO_alias_ has name of current flag image, referenced only by ISO 3166-1/USA FIPS 104-1 country codes.
- ISO: country_ISO_alias_ has name of Wikipedia article, referenced only by ISO 3166-1/USA FIPS 104-1 country codes.
- shortname: country_shortname_alias_ has a short common name, such as "United States" instead of "United States of America".
- Types presently defined:
- _alias_: suffix to indicate end of alias type.
- CountryName: name of country which is being addressed.
- CountryName-Modifier is also used, for historical or component references, such as Russian-SFSR to refer to Russia while a member of the USSR, or US-WI to refer to the US state of Wisconsin.
Aliasing example
Referenced as | Template addressed | Value in template | Usage |
---|---|---|---|
US | country_alias_US | United States | Wikipedia article: United States |
US | country_flag_alias_US | Flag of the United States.png | Flag: Template:Country data flagicon |
US | country_label_alias_US | USA | Small text label: Template:Country data flag |
US | country_shortname_alias_US | United States | Short country name: Template:Country data flagcountry |
Flag creation guidelines
Format
- Format: Use SVG format. It is preferred for drawings and iconic images. Images should be properly prepared for upload.
- Size: Use a size large enough to contain all the detail. It is easily shrunk to a desired size.
License
License: Use the appropriate license message from Image copyright tags. The summary below is a selection from the full list.
- {{PD}} - for when author has put into the public domain or the author died over 70 years ago (pre-1935). Consider first using the following subtags:
- {{PD-flag-US}} - for images of national, governmental, or historical flags out of copyright in the United States
- {{PD-flag-50}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 50 years
- {{PD-flag-70}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 70 years
- {{PD-flag-100}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 100 years
- Messages used with flags which are not properly identified:
- {{PD-flag}} - images of flags marked as public domain when in fact they might not be. Source information is often needed and licence information should be added if necessary.
Commons
It is not currently possible to use an image uploaded to one Wikimedia project in another one without re-uploading it. If you want to use the same image in more than one project, you can upload it to Wikimedia Commons and it would become immediately accessible from all Wikimedia projects. Note that Commons only accepts free images (public domain or licensed under a free license). If the image is fair use, you can't upload it to Commons. To upload the image existing on Wikipedia to another project you will need to download the image to your own computer (often right clicking on it will give you this option), and then re-upload that to the place you want the image to be copied to. Interlanguage links can be added between the two.
Country information definition
Including the countryedit template on the flag's page helps ensure the proper information is defined.
Finding flag images
Places to find flags:
- Some flags are in Category:Flags (SEWilco)
- Many flags use Template:PD-flag and thus that page's "What links here" page will show file names. (SEWilco)
- Searches by name can also be done in Special:Imagelist. (SEWilco)
- Wikipedia Commons: commons:Category:National flags. (SEWilco)
Future development
I am using the template array technology. There are proposed technologies which may be better. (SEWilco 05:46, 9 Jun 2005 (UTC))
- Wikipedia:Category - If templates could use categories, aliases might use them.
- m:Extended template syntax - More flexible template features.
- m:Field-value pairs - Additional data in articles.
- m:Flexible Fields for MediaWiki - Additional data in articles.
Archives
/Archive1: Archive of project when testing of flag template was completed. June 23 2005