Wikipedia:WikiProject Flag Template
From Freepedia
Templates for displaying a tiny flag image or other country information.
Contents |
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 usual country identification code.
- Modifier is an identification of the specific flag.
- Examples:
- {{flag|USA-48}}: Image:Us flag large 48 stars.png USA — the 48-star flag of the United States.
- {{flag|USA-MN}}: Image:Minnesota state flag.png MN — the USA state of Minnesota.
- {{flag|Russian-SFSR}}: Image:Russian SFSR flag large.png RUS SFSR — Flag of Russia while member of USSR.
- {{flag|Brazil-imperial}}: Image:BrazilEmpireFlag.jpg Empire of Brazil — Imperial flag of Brazil.
- {{flag|Brazil-1889}}: Image:Brazil-temp-flag.png BRA — 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)
- {{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}}: USA
- country|name: {{country|name|CountryName}}: United States — 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 recent Olympics page, as there is no Olympics page for each country.
- Names such as flagIOC-2000 should be used for Games which have detailed coverage. This ensures that links will point to specific Games despite future changes.
- Templates {{flagIOC-2000}}, {{flagIOC-2002}}, and {{flagIOC-2004}} exist.
- 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:
Template:Flag
- 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.
- 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)
- Uses sub-templates to alias various names for a country to a specific name.
Examples:
- none Image:Earth flag large.png Earth
- AUS Image:Australia flag large.png AUS
- Australia Image:Flag of Australia.svg AUS
- AUT Image:Austria flag large.png AUT
- Belgium Image:Flag of Belgium.svg BEL
- Earth Image:Earth flag large.png Earth
- Greece Image:Flag of Greece.svg GRC
- US Image:Flag of the United States.svg USA
- USA Image:Flag of the United States.svg USA
- United States Image:Flag of the United States.svg USA
- United States of America Image:Flag of the United States.svg USA
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}}:
| Name: "USA" ISO: "USA" IOC: "USA" | ||||
|---|---|---|---|---|
| Item | Usage | Content | Edit | Description |
| Flag | Image:Flag of the United States.svg | Flag of the United States.svg | Edit | Image of flag |
| Article | United States | United States | Edit | Article name |
| Label | USA | USA | Edit | Short label (ie, ISO abbrev.) |
| Common name | United States | United States | Edit | Common short name |
| ISO country code usage | ||||
| Code:Country | USA | USA | Edit | ISO country code for USA |
| Code:ISO | USA | USA | Edit | ISO country code for USA |
| Flag | Image:Flag of the United States.svg | Flag of the United States.svg | Edit | Flag image for {{ISO|flag|ISOabbrev}} |
| Article | United States | United States | Edit | Article name for {{ISO|flag|ISOabbrev}} |
| Olympic Games usage | ||||
| Flag | Image:Flag of the United States.svg | Flag of the United States.svg | Edit | IOC flag image |
| Article | Image:Flag of the United States.svg USA | United States | Edit | Article name for IOC use |
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||}}:
| Name: "USA" ISO: "" IOC: "" | ||||
|---|---|---|---|---|
| Item | Usage | Content | Edit | Description |
| Flag | Image:Flag of the United States.svg | Flag of the United States.svg | Edit | Image of flag |
| Article | United States | United States | Edit | Article name |
| Label | USA | USA | Edit | Short label (ie, ISO abbrev.) |
| Common name | United States | United States | Edit | Common short name |
| ISO country code usage | ||||
| Code:Country | USA | USA | Edit | ISO country code for USA |
| Code:ISO | none | none | Edit | ISO country code for |
| Flag | Image:Blank.JPG | Blank.JPG | Edit | Flag image for {{ISO|flag|ISOabbrev}} |
| Article | none | none | Edit | Article name for {{ISO|flag|ISOabbrev}} |
| Olympic Games usage | ||||
| Flag | Image:Blank.JPG | Blank.JPG | Edit | IOC flag image |
| Article | Image:Blank.JPG [[none at the 2004 Summer Olympics|]] | none | Edit | Article name for IOC use |
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: Image:Flag of the United States.svg |
| US | country_label_alias_US | USA | Small text label: Image:Flag of the United States.svg USA |
| US | country_shortname_alias_US | United States | Short country name: Image:Flag of the United States.svg United States |
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



