Jump to content

Wikipedia talk:WikiProject Flag Template: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Major rewrite of the project page
Line 1,252: Line 1,252:


I've done a major rewrite of the project page to adapt for the new template system used (the country data templates). --[[User:Ligulem|Ligulem]] 16:29, 9 February 2007 (UTC)
I've done a major rewrite of the project page to adapt for the new template system used (the country data templates). --[[User:Ligulem|Ligulem]] 16:29, 9 February 2007 (UTC)

== Some thoughts... ==
After spending lots of time working with the new templates, I have a few ideas for possible improvements that I'd like to discuss here:

===Bordered icons===
A few months ago, people starting using alternate flag images for flag icons, specifically, modifications to the "main" flag image to put a black border around it. The improvement is noticable at 22x20px (e.g. compare Japan at [[Image:Flag of Japan (bordered).svg|22x20px]] vs. [[Image:Flag of Japan.svg|22x20px]]). This method seems to have caught on instead of using the {{tl|border}} template for a couple of reasons (my speculation): it is simpler to add the bordered version to the flag template, thereby instantly updating all occurances, and it results in less complexity in the eventual page rendering.

One problem is that the bordered versions do not look very good when shown at a larger size. The {{tl|border}} template produces '''much''' better results. This means that editors are forced to use the image directly instead of using any of the flag templates (e.g. compare <nowiki>{{flagicon|Japan|size=150px}}</nowiki> vs. <nowiki>{{border|[[Image:Flag of Japan.svg|150px]]}}</nowiki>)<br>{{flagicon|Japan|size=150px}} vs. {{border|[[Image:Flag of Japan.svg|150px]]}}

What I would like to propose is that we add "icon alias" entries to the country_data templates for nations that need a "(bordered)" version for icon usage. The flag templates would select either "flag alias" or "icon alias" based on the presence of the "size" parameter or not. For example, the code for {{tl|country flagicon2}} would now look like:
<pre>
[[Image:{{
#if: {{{variant|}}} | {{{flag alias-{{{variant}}}}}} | {{#if: {{{size|}}} | {{{flag alias}}} | {{{icon alias|{{{flag alias}}}}}} }}
}}|{{
#if: {{{size|}}} | {{{size}}} | 22x20px
}}|Flag of {{{alias}}}]]
</pre>
(This is off the top of my head and not sandboxed, but you get the idea.)

One other benefit I can see by having both bordered and non-bordered versions of the flag within the country_data structures is that it might stop or reduce edit/revert cycles over which one is "best". Editors have two methods by which to get the flag they want. Normal usage of flagicon or flagcountry would give the icon version (if available); editors can override and get the non-bordered version by specifying any size (even 22x20px).

I think using the size parameter as the "key" for selection makes most sense because it is the size of the flag that determines whether or not the "(bordered)" versions look good or not.

===Hover label: "Flag of Country"===
The default hover box over flag icons is to use "Flag of <nowiki>{{{alias}}}</nowiki>", which is a great idea. One minor problem is that it produces incorrect grammar for some nation names. For example, it should really read "Flag of the United States" instead of "Flag of United States". The Netherlands, United Kingdom, Bahamas, and a few other countries also share this issue.

One extremely simple and effective fix would be to add something like "alias prefix = the" to the country_data structure for those handful of nations, and then change code to render the caption to:
<pre>
|Flag of {{alias prefix|}}} {{{alias}}}]]
</pre>

On a related note, I'd like to add a "See also" notice to {{tl|country showdata}} to link to the appropriate "<nowiki>[[Flag of {{alias prefix|}}} {{{alias}}}]]</nowiki>" article, as I think it would be a very useful reference for historic flag maintenance, and this would also be a good way to find all the nations that need the "the" prefix.

===National team templates===
I think by far the most common usage of flag icons is for sports result pages. It seemed as though they were mostly what I have been editing recently to update flag template calls. One observation is that several team sports each have their own very large set of flag templates that effectively reproduce what we have implemented here. For example, check out [[:Category:National football team templates]], which has approximately 850 templates alone! Other sports, such as ice hockey, rugby union and cricket all have similar template sets, but they are not as well-documented as the football ones.

Some problems with this system are that the calling convention for historic flags is different between sports, and different from the variant labels we have started to use. Furthermore, they are not always accurate or complete. For example, not all of the US flag variants exist, so some editors had to resort to using the image directly. Another example - Canada is shown as only having one historic flag (see {{tl|CANfold}}) when there were actually three different red ensigns.

What I'd like to propose, and this will have to be done with approval of each sport's WikiProject, is to consolidate upon the country_data templates and replace the sport-specific templates. It was trivially easy to create a single template that I would estimate can be used for 90% of those football specific ones. I created {{tl|national sports team}} as the main template to render the flag and link, and then {{tl|fb}} for a football specific one.

For example:
{| class="wikitable"
!colspan=2|Old !! → !!colspan=2|New
|-
| <nowiki>{{ITAf}}</nowiki> || {{ITAf}} || → || <nowiki>{{fb|ITA}}</nowiki> || {{fb|ITA}}
|-
| <nowiki>{{ITAfold}}</nowiki> || {{ITAfold}} || → || <nowiki>{{fb|ITA|old}}</nowiki> || {{fb|ITA|old}}
|}

This is an '''extremely''' scalable system. We only need per-sport templates (like {{tl|fb}}) for football, but for ice hockey, basketball, rugby union, etc. as per [[:Category:National sports teams]] to replace over a thousand specific instances. There are a few special cases where the team flag is different or the team name is different (e.g. instead of [[New Zealand national rugby union team]], the preferred name is at [[All Blacks]]), but the beauty of the country_data system is that special cases can be handled there (for example, use an override parameter like "rugby union national team = All Blacks" inside country_data_New_Zealand). Some tweaking to {{tl|national sports team}} is needed to pick up those names, as is handling of nations that have both men's and women's team articles, but neither is a big deal.

In any case, I'd like to get some discussion and consensus here before bringing this to the respective sports wikiprojects. [[User:Andrwsc|Andrwsc]] 20:09, 20 February 2007 (UTC)

Revision as of 20:09, 20 February 2007

Icon with text

Using the same format of such as Template:AUS, with both flag icon and text link, allows non-graphical readers to know what is being linked as well as supply a link to the subject matter. Would a captioned image with link be equally satisfactory? (SEWilco 04:11, 6 Apr 2005 (UTC))

  • No comments. Following original example, implemented as both image and text with both linked to country article, rather than only an image linked to country article. (SEWilco 05:00, 8 Jun 2005 (UTC))

Country alias policy

I haven't found the Wikipedia policy on country names. I view the aliasing in this template as a convenience for editors. Wikipedia software or a bot could rename aliases to follow a standard. (SEWilco 19:15, 6 Apr 2005 (UTC))

Flag template policies

  • Editor convenience: It is acceptable for the template to accept several names for the same country. (SEWilco)
  • Iconic purpose: Template's purpose as an iconic display requires short text labels. (SEWilco)

From Village pump (news)

Discussion intitally moved from Wikipedia:Village pump (news)

This is the original discussion which introduced the country icon issues.

Flag template introduction

Various people including User:Earl Andrew and User:Aris Katsaris and others have created several dozen flag templates, such as Template:POL, Template:ITA, and so forth, and have been gradually introducing them in pages like European Parliament and List of cities by latitude and 2002 Winter Olympics and many other places.

I see a few problem with this:

  • These can be a bit cryptic (for instance, Austria is Template:AUT, and Australia is Template:AUS). This conflicts with the basic wiki idea that "anyone can edit any page", because in order to edit some pages, people will need to be familiar with these three-letter codes.
  • There are occasional conflicts with existing templates, for instance Template:IND (for India) is already taken for another purpose.
  • It's not clear what standard should be followed... one possibility is ISO 3166-1, another possibility is List of IOC country codes (these have major differences). Again there are possibilities for confusion: the IOC code "CHI" is Chile, not China, the IOC code "SLO" is Slovenia not Slovakia, etc.

One suggestion would be to use fully-spelled out names like {{AUSTRALIA}}. Another suggestion from Earl Andrew would be to invent our own five-letter codes (but I think these would be non-standard, and "Austr" still isn't enough to distinguish Austria from Australia or Dominica from Dominican Republic.

Anyway, it might be good to get some wider input into this. What do you folks think? -- Curps 23:36, 28 Mar 2005 (UTC)

Country codes

If you need a code for countries, why reinvent the wheel? Use the international standard 2- or 3- letter codes defined by ISO 3166. Gdr 21:37, 2005 Mar 29 (UTC)
Flag templates should not take over country code names. That would be like Template:Country_USA for a flag, when such a name should be for a template relevant to the country as an entity. Perhaps have "flag" someplace in the template name? Of course, such an aforementioned Country template probably should display the proper flag also… (SEWilco 06:15, 1 Apr 2005 (UTC))


Non-nation entities

There are some cases where non-sovereign or non-state entities engage in international activities (eg, Scotland has its own sports teams, Puerto Rico has its own Olympic team, Taiwan competes as "Chinese Taipei"). If we wanted to add flags to the Francophonie article, we'd need flag templates for Quebec and French Community of Belgium. So neither ISO 3166-1 and List of IOC country codes really fill all the needs... and we might very well want to have flag templates for US state flags or Canadian province flags, for an article on election results for instance.

So, ideally, some general solution should be invented, and without requiring memorization of hundreds of cryptic codes.

Right now dozens of flag templates have already been created a bit haphazardly, so the reason for posting here was to try to gather consensus and ideas. -- Curps 12:44, 1 Apr 2005 (UTC)

Well, Please dont delete the template untill we get a vote here. I want to provide information in both articles regarding the man I dont want to copy paste material as if any change happens it should affect the other page instantly. --Cool Cat My Talk 12:55, 1 Apr 2005 (UTC)

Definitely (oops, I misspelt IMHO) the template names need to contain the word "flag" in some form, eg, template:Flag of FRA. To identify the country/state/place/thing I'd vote for the iso alpha-3 or alpha-2, since some country names are long and have various forms, at least in common use. Since the creators have aleady used the alpha-3 I'd say stick with that. The occasional obscurity of the alpha codes I would not consider to be a meaningful barrier to their use. Sharkford 21:50, 2005 Apr 1 (UTC)
Actually, the creators did not seem to have stuck with alpha-3 in a consistent way, which was part of the reason for bringing up the topic here. -- Curps 09:40, 6 Apr 2005 (UTC)

General country reference

I'll expose my ignorance: Why not {{flag|FRA}}? Or {{country|FRA|flag}}? A Template:country would be for various forms of references to countries, perhaps for symbols, "more info" boxes, or variable text. (SEWilco 05:14, 2 Apr 2005 (UTC))
good idea with the general template. I would favor using ISO-Alpha3 because Alpha2 can change to quick and with Alpha3 we have more room for own inventions as there are more "reserved for own use codes". This codes should possibly used for maps as well. Full name is just to long and we could not use it on commons because people from non-english WPs, e.g. german people, will not use "Germany" but prefer "Deutschland". codes avoid language issues. I know 99% of the alpha2 codes if you wake me up from my deepest dreams, but I do not know nearly 2% of the alpha3 codes. We all will get used to it :-) One downside of alpha3, copyright? Tobias Conradi 12:44, 2 Apr 2005 (UTC)
Meaning vs brevity
Keep "flag" out of it. They need to be as short as possible, I believe that is the point of the template. -- Earl Andrew - talk 03:04, 4 Apr 2005 (UTC)
The main benefit of templates is the standardization they provide; brevity is a secondary benefit, which shouldn't be at the expense of clarity. There's no point in saving a few keystrokes of typing if it entails a much longer delay in manually looking up an obscure code; this actually loses time rather than saving it. -- Curps 09:40, 6 Apr 2005 (UTC)
No matter what we use, there's going to be an obscure code that will need to be looked up. The smaller the said code the better. -- Earl Andrew - talk 19:11, 6 Apr 2005 (UTC)
I think Anglo-Saxon readers would have difficulty with {{F|Canada}}. I think "flag" is necessary to specify the purpose of the template (reference to a flag), while merely having a country name as a template does not make clear what aspect of the country is being referred to. Thus, a "country" template is a more general view of the "flag" problem: How to refer to something which is related to a specific country. As flag presentation was the problem which was mentioned, that implies that a template for flags is of interest, possibly in addition to a more general solution for country references. (SEWilco 10:15, 5 Apr 2005 (UTC))

Help... ISO-like codes? Tags? Flag icons?

Please excuse my newbie questions:

What are these (please see below) and where can a complete list be found?

The three letter identifiers are not always an ISO country code.

(Edit this section, to see the wiki source code, such as {{AUS}}  Australia )


 Australia  Austria  Bahamas  Belgium  Canada  China  Denmark  Egypt  France  Fiji  Germany  Greece  India  Italy  Japan  Mexico Template:MOC  Monaco  Malaysia  Netherlands  New Zealand  Panama  Philippines  Portugal This template must be substituted.  Sweden  Switzerland  Thailand  Taiwan  Sri Lanka  Soviet Union  Vatican City


 United Kingdom  England  Ireland  Scotland  Wales


 Hong Kong  Macau  Singapore


 Bermuda Template:CEU


 American Samoa Template:AZO  Maldives  Palau


Sometimes, this one has a gray box and dotted lines, and sometimes NOT... Why?

Template:CEU


Guam Guam   Federated States of Micronesia Chuuk (or Truk Lagoon)   French Polynesia Tahiti, French Polynesia


GeoFan49 06:38, 17 December 2006 (UTC)  :: Puzzled....[reply]

Think I have just found a solution, with some testing here: User:GeoFan49/Flagtest

GeoFan49


Introducing Template:Flag

Well, trying Template:Flag. There is an assortment of file names for flags. Such as Image:Flag of Canada.svg ( Canada) while USA's seems to be Image:us flag large.png ( US) (SEWilco 20:26, 5 Apr 2005 (UTC))

  • Template:Flag aliasing test:  Canada,  US,  USA,  United States of America. Only those countries presently work. (SEWilco 20:26, 5 Apr 2005 (UTC))
  • Two more flag references which work: Template:Country data Earth,  [[|]]. The second one is for a null parameter. ({{flag|}}); I did not make a default ({{flag}}), as I could not reference file {{{1}}}.
  • There is a limit on subpages. Is there an incantation to extract part of a parameter, so if parameter 1 is USA, the "U" can be used in the template? (SEWilco 20:26, 5 Apr 2005 (UTC))
  • Should we move this out of Village Pump? (SEWilco 20:26, 5 Apr 2005 (UTC))
    • Perhaps, but where? -- Curps 09:40, 6 Apr 2005 (UTC)

ISO codes

I personally think thatwe should use the ISO codes, since there will be little confusion. Though there is obscure codes for countries (HR for Croatia, CS for Serbia and Montenegro, OT for Austria), we can always provide a list of these codes and make the minor edits when needed. Zscout370 01:35, 9 Apr 2005 (UTC)

ISO codes is being discussed in a section below. Basically: Yes, ISO codes make sense. The intent is to allow editors to also use common names, but the template will find the proper name of the flag file. The short text label next to the flag will be the ISO code because this is intended as a short icon. There will also be a way to produce other labels, such as the Olympic country codes. (SEWilco 04:39, 9 Apr 2005 (UTC))

Country aliases

  • Aliases are done by having one template for each country or alias (this is called a template array).
  • Alias templates follow the pattern country_alias_Name.
    • Contents of the country alias is the name of the country's Wikipedia page (ie, United States).
  • Alias templates for flags follow the pattern country_flag_alias_Name.
    • Contents of the country flag alias is the name of the country's flag image (ie, us or Us); the rest of the image file name is appended by {{country_flag}}: _flag_large.png.
    • Other types of aliases could be created with other template arrays, such as country_ISO_alias_Name. Note: alias should be last, otherwise similar names can occur for a country named "ISO".
    • ISO codes
      • avoid US based FIPS 10-4
      • some US FIPS FIPS 104-1 codes may need to be updated to current usage
    • for entities that have no code
      • make up our own in the reserved code space (ISO has one)
        • own codes have to be published as wikimedia-codes somewhere (wikibooks?)
  • coordinate with other country file names
    • maps
    • coat of arms
    • [please extend]
  • see also: commons:Commons_talk:Language_policy/Archive1#Naming_policy_for_country_and_country_subdivision_related_files

Technical issues

  • Anyone see a way to only need alias files for exceptions, rather than for every flag? (SEWilco 18:30, 6 Apr 2005 (UTC))
    • There is not way to use the alias files for more than only the alias. That is, to store information other than the one-line alias entry. There is not a way to make a Template use part of a file or string. (SEWilco)
      • Separate aliases are used for the flag and country, as some flag files do not have same name as the country. (SEWilco)
      • Most countries have flag image files which follow a certain pattern. Some missing flags will be copied to new names. (SEWilco)
  • how to handle the approx 130 countries? not to mention subnational entities? templates with database? how to do this? Tobias Conradi (Talk) 10:49, 9 Apr 2005 (UTC)
    • I mentioned the number of countries as being an issue, and that is why I have not already fully populated an Alias table. (SEWilco)
    • Separate Alias name spaces can be created, so FlagState|USA|MN would refer to separate Aliases for USA states. (SEWilco)
      • please no template FlagState, use Flag|US-MN, that's it.Tobias Conradi (Talk) 17:32, 11 Apr 2005 (UTC)
    • I'm trying to find ways to detect when an Alias file is not needed, such as by discovering "Italy" files exist. There seems to be no way to do this, as a missing Alias template always appears as an undefined part of the template. (SEWilco)
    • Various people have proposed enhancements which would allow replacement of this Alias File hack. If a better technology appears, the template will be changed. References to templates can be updated. (SEWilco 18:27, 10 Apr 2005 (UTC))

Text display

  • allow different text displays, example in IOC context IOC codes might be needed.
  • an issue? Tobias Conradi (Talk) 17:18, 6 Apr 2005 (UTC)
    • Use USA FIPS 104-1 American National Standard Codes for the Representation of Names of Countries, Dependencies, and Areas of Special Sovereignty for Information Interchange. (SEWilco 18:21, 6 Apr 2005 (UTC))

Nation Icon

Is this actually intended as a "nation icon", where the flag is actually just a symbol for the country? (SEWilco 06:56, 16 Apr 2005 (UTC))

  • If this is the case, try viewing this topic as "identification of a nation" and "display of nation link" (SEWilco)
  • Display may differ based on context — some contexts may link to nation page, others to Olympic nation page. (SEWilco)

Taiwan vs Republic of China

During the update done by SEWilcoBot on the 26th of June, the distiction between {{TWN}} (which should appear as "Taiwan Taiwan" but currently appears as " Taiwan") and {{ROC}} (which should appear as "Republic of China Republic of China" but currently appears as " Republic of China") was blurred. The reason for this distiction is that users sometimes want to use "Taiwan" and sometimes want to use "Republic of China". Could you repair this? I'm having trouble tracing your template back. Thanks -Bill 4 July 2005 17:35 (UTC)

  • I see; references under various names got intermingled during setup of the edits. OK, I fixed it so references using Taiwan or TWN use that name (as "Common name"), while ROC references use Republic of China or ROC. I changed {{TWN}} to use Taiwan reference, which then displays that name. (SEWilco 5 July 2005 07:53 (UTC))

Template:Countryedit Template:Countryedit Template:Countryedit Template:Countryedit

This issue cropped up again with the recent updates. {{Country data Taiwan}} no longer re-directs to {{Country data Republic of China}}. --129.241.210.227 00:08, 1 February 2007 (UTC)[reply]

I was puzzled about your post, because everything looked as Bill requested it above here. Then I saw you already changed it [1]. --Ligulem 00:28, 1 February 2007 (UTC)[reply]

Oops.

I actually stumbled across this page *after* standardizing the templates to the ISO codes... Well.

To summarize it briefly: For those countries that did not have this template at Template:ISO (ISO being the three-letter code of the country), I created the templates; and I resolved the issue (the only issue, actually) with Template:IND by agreeing with User:SPUI to change his instances of {{IND}} to {{IND (NYCS)}} for him. I hope I could help with that, even though I just stumbled upon this page... Nightstallion 19:50, 23 May 2005 (UTC)[reply]

No problem, we're still working on this template. There are several awkward issues due primarily to template limitations. (SEWilco 04:02, 24 May 2005 (UTC))[reply]
Okay. If I can be of any further help, just tell me. Nightstallion 06:16, 24 May 2005 (UTC)[reply]
I'm changing the underlying technology now, more soon. Oh, your above example doesn't make too much sense when {{IND}} shows the IND flag; looks to me like you mean SPUI had Template:IND for the subway system and he accepted your renaming. Did you do all that manually or do you have a bot? (SEWilco 08:36, 25 May 2005 (UTC))[reply]
Corrected my post above. I actually did it manually. Nightstallion 11:03, 25 May 2005 (UTC)[reply]
Well, you encountered one problem with trying to take over template names as country aliases. I'm avoiding that by using "country_alias_" as a prefix for a template array. But before you go populating another array we need to design things. (SEWilco 07:35, 26 May 2005 (UTC))[reply]
I created Template:Country as a general interface for such things. Now Flag is coded as {{country|flag|CountryName}}. For ISO, it could be {{country|flagISO|CountryName}}} or the template design might be changed to {{country|flag|ISO|CountryName}}}. I have to test whether we could have an optional parameter so {{country|flag|CountryName|ISO}} would be a possibility. (SEWilco 07:35, 26 May 2005 (UTC))[reply]
I expect that few people will want to call Template:Country directly, and a number of shortcut aliases for various actions will exist. Template:Flag already exists (although a name change has been requested). I just now created Template:ISO for ISO-related usage, for when we figure this out. (SEWilco 07:35, 26 May 2005 (UTC))[reply]
I assume an "ISO" reference should display differently than non-ISO usage. For example, although at present flag will show the USA flag for US, USA, or United States, it uses the specified label rather than a standardized one such as USA. For ISO, the appropriate ISO label should be shown. This probably should involve an "ISO alias" table, display the ISO label, but link to the country page. For IOC, perhaps a link to a country's Olympic info would be wanted. A related issue is that I need to add translation from country aliases to flag aliases; the USA flag is in a file named "Us" and that is not a suitable country label, but that should be easy to implement in the flag template. (SEWilco 07:47, 26 May 2005 (UTC))[reply]

ISO template

Template:ISO now creates a flag icon and text linked to the country's Wikipedia page. The only parameter given should be an ISO country code (see Usage in its Talk page). That parameter is also the label next to the flag. The template does not restrict country codes, they are simply defined as required to be ISO codes. (SEWilco 06:15, 9 Jun 2005 (UTC))

  • Should Template:ISO be defined as creating its present icon-and-text format, or should it have a more ambiguous or specific definition? What is intent of usage? (SEWilco 06:21, 9 Jun 2005 (UTC))
  • Example: {{ISO|flag|USA}}: Template:ISO (SEWilco 06:28, 9 Jun 2005 (UTC))
    • I see no ISO here. "Us" is not.Tobias Conradi (Talk) 22:31, 9 Jun 2005 (UTC)
      • "USA" is the ISO country code for the United States of America. It is the invoked country code which should follow the standard, for referring to countries. (SEWilco 04:35, 10 Jun 2005 (UTC))
    • Could someone be ever so nice and make it work with UK as well as GB or GBR or whatever misnomer the ISO uses? Dmn / Դմն 09:01, 9 Jun 2005 (UTC)
      • Don't do this. It is not a misnomer, it is an ISO standard. You can go for ICANN-standard if you prefer that. Tobias Conradi (Talk) 22:23, 9 Jun 2005 (UTC)
        • Right. Only the ISO country codes should be used with the ISO template. The {{country|flag|CountryName}} has fewer usage restrictions. (SEWilco 04:35, 10 Jun 2005 (UTC))

Taking the template name "ISO" is a bit presumptuous. There are a lot of ISO standards. {{ISO flag}} or {{ISO 3166-2 flag}} would be better names. Gdr 11:00, 2005 Jun 9 (UTC)

  • maybe "ISO 3166" is sufficient, if template can recognize the 5 possible formats. 1: AA, 123, AAA ----- 2: AA-... ------- 3: AABB Tobias Conradi (Talk) 22:31, 9 Jun 2005 (UTC)
    • The template has no error checking. As long as the formats do not overlap they can all be used. It is just a matter of defining each alias entry. The only difference between the ISO flag coding and others, such as the IOC, is that each has its own aliasing namespace so the internal names don't collide. It is trivial to create additional templates if separate namespaces are wanted for various flavors/formats. But before flooding namespaces one should consider whether there is a need for many country codes; if the only usage will be one table listing all the country codes then populating the templates is an arguable exercise. (SEWilco 04:35, 10 Jun 2005 (UTC))
  • That's why I'm asking about best use of "ISO" before it becomes popular. My previous observations about the generality of a template named "country" apply. Actually, I'll immediately change "ISO" so it requires a parameter which indicates the intended action ("ISO|flagISO"). (SEWilco 18:27, 9 Jun 2005 (UTC))
    • ISO|flagISO? why not ISO|flag? what other actions are possible?Tobias Conradi (Talk) 22:23, 9 Jun 2005 (UTC)
      • After further reflection, I changed it to "ISO|flag". At the moment there are no other actions defined. Adding more country-related actions is easy; I believe I also know an incantation which can redirect to non-country-oriented templates as well. But is there a need at the moment to stress the template? (SEWilco 04:35, 10 Jun 2005 (UTC))

Component states

It has been suggested that rather than creating new incantations, members of existing countries be referenced as components of the larger entity. For example, the American state Minnesota be addressed as USA-MN (MN is the official postal abbreviation). This will work within existing country subtemplates. It also avoids the naming complexity if more flavor templates were created, as component or members have an assortment of names: state, commonwealth, province, republic, etc. (SEWilco 06:42, 9 Jun 2005 (UTC))

Alternate flags

It has been pointed out that some contexts require use of different flags for countries. (SEWilco 04:55, 10 Jun 2005 (UTC))

Suggested flag modifier addresses:

Alternate flags technical issue

At present flag file names must end with _flag_large.png, as that happens to be the name used for most flags. This suffix is included within the templates, and the "flag alias" templates only contain the prefix; for the USA this is "us" to reference "us_flag_large.png". More flexibility is possible if the suffix is removed from the templates, so the "flag alias" templates will have to have to be edited to make this change. This is trivial to do by hand as there are presently few.

  • I changed the templates to require the full flag file name (ie, us_flag_large.png). The prefix Image: is added by the templates. (SEWilco 00:14, 15 Jun 2005 (UTC))

Please Rename {{flag}}

(moved from project page - SEWilco 23:54, 14 Jun 2005 (UTC))

I strongly recommend that Template:Flag and your other two templates mentioned above be renamed because a number of users are confusing this with {{PD-flag}} when tagging images. In other words, the page Template:Flag should actually redirect to Template:PD-flag. Thanks. Zzyzx11 (Talk) 05:56, 21 May 2005 (UTC)[reply]

Noted. I'm working on something which will take care of this. (SEWilco 04:45, 25 May 2005 (UTC))[reply]
Implemented generalization: {{country|flag|USA}}. If shortcuts are wanted, perhaps flagicon so it is different than flag? (SEWilco 05:43, 8 Jun 2005 (UTC))
Not that having a pile of garbage due to misuse is stopping people from misusing {{flag}} now: Image:Confederate.png has been showing garbage which the uploader apparently didn't fix, so why would doing something with flag matter? Aliasing flag to PD-flag wouldn't confirm that the uploader intended to label the flag image as PD, as perhaps the person was just trying to attach Category:Flag. If templates could recognize missing parameters, {{flag}} could emit a reminder box when no parameter is given... (SEWilco 05:43, 8 Jun 2005 (UTC))

It looks like this entire scheme needs to be reviewed. I see templates calling templates calling templates, and it's ugly. Creating a better series of templates should have been trivial using a bot, and I don't see on-going maintenance as a problem. Read the above guideline and let's start getting out ideas. -- Netoholic @ 17:19, 13 July 2005 (UTC)[reply]

Getting a new flag added?

For distinguishing WWII-Japan from other periods (i.e., the current governments), it would be useful to have a little flag icon for Image:Imperial japan.png. But I can't seem to get it to work using the flagicon template ({{flagicon|Imperial japan}} produces: {{flagicon}}). Help? I don't quite understand how this works. --Fastfission 22:10, 2 August 2005 (UTC)[reply]

  • To avoid confusion, including between various Japanese "empires" through history, also consider a name such as "Japan-Naval-1954" or "Japan-Naval", rather than "Imperial Japan". According to Flag of Japan, this flag was not an "Imperial Japan" flag, but rather a military flag and was re-adopted in 1954 as the Naval Ensign. Note that "Japan-Naval" should always show the current flag for the Navy, while "Japan-Naval-1954" the flag adopted in 1954; at present the two are the same. (SEWilco 05:47, 3 August 2005 (UTC))[reply]
  • Two ways to create information for a flag are to either click on the red links and enter the proper information (one red link is a single character), or to use {{countryedit}} to show the needed information. I'll fill it in for "Japan-Naval" below (the present template has ISO and IOC areas, but those are not used for the Navy). Hmm. Japanese Navy redirects to the historical Imperial Navy but that can be expected to change soon. (SEWilco 05:47, 3 August 2005 (UTC))[reply]

Template:Countryedit

    • Many thanks. I just wanted it because for some purposes it makes sense to distinguish between the gov. of WWII Japan and Japan of today (i.e. in List of countries with nuclear weapons, which includes an entry for both). I know it is not strictly speaking only the flag of that government, but it is the one most people associate with it (and has some legitimate claims). --Fastfission 16:06, 5 August 2005 (UTC)[reply]
      • According to Flag of Japan, during WWII the Hinomaru was the country's flag. Using the military flag for non-military purposes is "not strictly speaking" correct, and likely to waste another editor's time correcting what you already know is not true. (SEWilco 17:23, 5 August 2005 (UTC))[reply]

Smaller flags

See: Wikipedia_talk:Country_referencing_templates#Smaller flags Bart l 20:45, 7 September 2005 (UTC)[reply]

Template redirects

It seems to me this project should be using more template redirects. For example, I just changed Template:Country flag IOC alias USA, Template:Country flag ISO alias USA, and Template:Country flag alias USA to redirect to Template:Country flag alias United States, since they all have the same semantic meaning.

Also, could someone check my changes to Template:Country flagISO? I don't think I broke anything—can someone else confirm that? dbenbenn | talk 19:49, 10 September 2005 (UTC)[reply]

Flags

Currently, many templates (for example those for Austria or the French dependencies) use older flags, while .svg flags already exist. Furthermore, Guadeloupe and Martinique templates currently use inofficial flags; the official flags are the same as France's. I really don't have a clue as to how to change that, though. File:Austria flag large.png ナイトスタリオン 09:35, 23 October 2005 (UTC)[reply]

You might try the {{countryedit|Austria||}} tool. (The last two parameters are for the ISO and IOC countyry codes; "AUT" is the ISO code.) (SEWilco 21:16, 23 October 2005 (UTC))[reply]
How exactly does that work? I'm afraid I really don't know too much about the more complicated parts about how the Flag Template currently works... Best I can do is compile a list of outdated flags still used in the template. File:Austria flag large.png ナイトスタリオン 10:07, 24 October 2005 (UTC)[reply]
Never mind, I just figured out I can actually edit the templates via "Template:country flag alias +++++". I'll get to work, then. File:Austria flag large.png ナイトスタリオン 11:12, 24 October 2005 (UTC)[reply]
You can put the above "countryedit" incantation in any edit page, hit Preview, and in the result there are Edit links. Often easiest if you open the Edit link in a new window/tab. The ISO section will report the ISO abbreviation, which you can then put in the 2nd parameter field; you might have to look up the IOC abbreviation if it is not obvious. Some flag image or talk pages already have relevant countryedit incantations, particularly some countries which have several names. (SEWilco 16:53, 24 October 2005 (UTC))[reply]

Improve template design?

{{flag|WLF}} {{flag|Wallis and Futuna}} {{country|flagcountry|Wallis and Futuna}}

The first brings VGB as code and uses a flag different to the following two. The flag used by flag|WLF is not the VGB flag even if the code is like that. It seems as if the design of the templates could be improved. If WLF is passed as a param it should used directly as output. Showing VGB should not be possible. Maybe a lot of meta-templates are superfluoes then. Tobias Conradi [[User_talk:Tobias Conradi|(Talk)]] 06:28, 15 November 2005 (UTC)[reply]

Showing VGB is possible if that is what is stored for the alias WLF. It looks like that is wrong, so do you want to fix it or want someone else to do it? It is a French overseas collectivity, but it has its own flag so its own flag should be used. (SEWilco 12:27, 15 November 2005 (UTC))[reply]
I would like to change the design. if WLF is the param than WLF should be shown. For the flag thing: I still miss an explanation why different flags are shown for WLF / why this "(bug?) feature" needs to exist. Tobias Conradi (Talk) 13:38, 15 November 2005 (UTC)[reply]
The design produces a consistent result. Try several names for the United States. I changed the WLF flag back to its own flag, although one editor noted that the French flag is the official flag. If you don't want the label WLF, perhaps you should use {{flagicon}} or {{flag|WLF|name=My home}}. (SEWilco 13:59, 15 November 2005 (UTC))[reply]
The official flag of Wallis and Futuna is the Flag of France. In my opinion, the standard template {{WLF}} should show the official flag. We could use {{WLF2}} or {{WLFalt}} for people who want to use the inofficial flag. File:Austria flag large.png ナイトスタリオン 13:57, 15 November 2005 (UTC)[reply]
Back to France, then. (SEWilco 14:06, 15 November 2005 (UTC))[reply]
Aye. Thanks. Same holds true for a number of other dependencies of France and Australia, but I've got them on my watchlist, anyway. ;) File:Austria flag large.png ナイトスタリオン 14:24, 15 November 2005 (UTC)[reply]
No. We need to be able to distinguish these French territories with their own flag from France proper, as with all other dependent territories with their own flags, unofficial or not. Denelson83 02:37, 21 May 2006 (UTC)[reply]

Template:Countryedit Template:Countryedit

Problems with Template:Flagcountry

I've been using Template:Flagcountry for a while, and I think there are some problems with it. Here's the template:

[[Image:{{country flag alias {{{1}}}}}|25x15px|{{country alias {{{1}}}}}]] [[{{country alias {{{1}}}}}|{{country shortname alias {{{1}}}}}]]

Basically there are four parts here:

  1. country flag alias {{{1}}} - The image wikilink of the country's flag
  2. 25x15px - The displayed size of the flag
  3. country alias {{{1}}} - The wikilink of the country's article
  4. country shortname alias {{{1}}}}} - The displayed name of the country

Obviously, for each country, there is a unique image wikilink to its flag, and a unique wiki-link to its article (plus maybe a few redirects), so it makes sense to implement them using templates. However, for the other two, the problems are:

  1. The users may want to use different sizes of the flag.
  2. The users may want to use different displayed names. For example, for the country People's Republic of China, the users may want to display any one of these names:
    1. China
    2. People's Republic of China
    3. China, People's Republic of
    4. China (PRC), etc....

There have recently been some debate over what Template:Country shortname alias China should be. My point is, there is no unique answer! All of the above are acceptable displayed names.

So I propose we should have a template like this:

[[Image:{{country flag alias {{{2}}}}}|{{{1}}}|Flag of {{country alias {{{2}}}}}]] [[{{country alias {{{2}}}}}|{{{2}}}]]

So it can suit everybody's needs. I guess we can call it Template:Flagcountry size name, given that it's similar to Template:Flagcountry, but requires two inputs, {{{1}}} = size and {{{2}}} = name. Ther users can use the template to display something like:

Chanheigeorge 00:20, 28 October 2005 (UTC)[reply]

Well, the purpose of the templates is to provide common information. The flag and name of country are stable. There are possibilities for more flexibility. One option is to use {{flagicon}} for the flag and whatever you want near it. Another solution is to use the new template abilities; I could add "size" and "name" as optional parameters. I don't know if expansionist modification would be better than a new template which uses the same database. Incidentally, look at the Edit page for {{flagcountry}}. (SEWilco 04:43, 28 October 2005 (UTC))[reply]
Sounds good! I recently faced the same problem on the List of flags page. For the none country flags, I have to include the link to the image, size and comment anyway. But for the countries (not implemented yet) I'll have no other option currently to display larger icons, except the one above. Bart l 11:21, 29 October 2005 (UTC)[reply]
  • {{flagcountry|China}}:  China
  • {{flagcountry|China|size=50px}}:  China
  • {{flagcountry|China|name=Chinese flag}}:  Chinese flag
  • {{flag|China}}:  China
  • {{flag|China|size=50px}}:  China
  • {{flag|China|name=Chinese flag}}:  Chinese flag
  • {{flagicon|China}}: China
  • {{flagicon|China|size=50px}}: China
— (SEWilco 13:16, 15 November 2005 (UTC))[reply]
Sorry that I'm not familiar with optional parameters, but is it possible to have both name and size? Chanheigeorge 01:41, 16 November 2005 (UTC)[reply]
Yes. You can test it in a Sandbox or any Preview page. (SEWilco 03:57, 16 November 2005 (UTC))[reply]

As of this writing, I have not been able to find a suitable template for displaying the IOC three-letter country code with a link to the country, instead of the full linked-to country name. So I inserted the necessary code into my own Template:Biathlon flagresult (Talk). --Wernher 23:31, 15 November 2005 (UTC)[reply]

country shortname alias xxx

I propose phasing out the templates country shortname alias xxx. Right now almost all of these templates equal xxx anyway, so I don't see why we need them. Using them in implementation merely adds another layer of editing, plus this means people can "edit" the displayed country names in a page without actually editing the page. Chanheigeorge 01:09, 20 November 2005 (UTC)[reply]

One reason they are needed is in your observation that "almost all" are the same; the exceptions is one reason. Also your phrasing "these templates equal xxx" suggests that you're referring to use of three-letter templates, but the information is also used by other template incantations, such as giving {{flag}} the name of a country rather than a three-letter country code. (SEWilco 05:55, 20 November 2005 (UTC))[reply]
Incidentally, you may be confusing the template array country_shortname_alias_xxx with a template. This array is a data storage tool and not a template. It also is considered temporary, until proposed data storage tools are created. (SEWilco 05:55, 20 November 2005 (UTC))[reply]

NGOs and other Multinationals

Are there flag templates for international organisations such as the UN, EU, the Commonwealth, Nato and Red Cross? They would be useful for lists. --cj | talk 07:56, 26 November 2005 (UTC)[reply]

Most of those aren't countries. If they are needed, create separate templates for such non-country symbols. Perhaps they should be documented at the top of the Talk page for the organization's article. (SEWilco 03:38, 28 November 2005 (UTC))[reply]

The entire templating system around this project is in violation of the WP:AUM policy. The developers have confirmed that templates calling or within other templates cause extra processing. This policy has been reaffirmed by the Arbitrators as valid. The template namespace is not a general data repository. Please begin discussing transition plans towards use one-level templates to perform these functions. -- Netoholic @ 23:00, 10 January 2006 (UTC)[reply]

no fear. WP:AUM is more than only server load. And even the server load issue is less an issue if the metatemplates are not edited. Maybe protect the metatemplates from editing as is said in WP:AUM -> Alternatives -> Protecting. Tobias Conradi (Talk) 22:57, 11 January 2006 (UTC)[reply]

Problems ?

{{flag|BHR}} does not work, looks like this:  BHR

{{flag|IOT}} does not work correct, still shows the old .png flag  IOT

Adding the Canadian Red Ensign

I've noticed that the project is lacking a template page for the Canadian Red Ensign flag used by Canada in various roles before the modern maple leaf flag. Currently, there are two Red Ensign flags in use here, Image:redensign.png (more commonly used, but contrary to project goals) and Image:Canadian Red Ensign.svg (in accordance to project policy, from Commons). Some help in adding this flag would be appreciated. kelvSYC 08:01, 26 February 2006 (UTC)[reply]

issue with flag|

{{flag|Trinidad and Tobago}} brings TTO while {{flag|United Kingdom}} brings UK

easier both should bring the Name or both the ISO 3166-1 alpha-3 code.

BTW how do I get the full name?

Tobias Conradi (Talk) 16:33, 2 March 2006 (UTC)[reply]

The flag template doesn't do the name, you have to use the country template. for example {{country|flagicon|UK}} {{country|name|UK}} result in Template:Country data flagicon Template:Country data name. --Sherool (talk) 11:59, 6 April 2006 (UTC)[reply]

State vs civil flags

I've been working on cleaning out the old redundant png and gif (and even soem jpg) flags, updating the various alias templates as I go, but I've noticed some inconsistencies. Some countries have theyr state flag as the default one, while most have the civil flag. Case in point  San Marino who's civil flag is actualy this: . Is this correct? I'm no flag buff, but my understanding is that only the Government and/or military tend to fly the state flag of a nation so we should be using the civil flag as default no? Or do some nations use the state flag as the de-facto standard for everyting? --Sherool (talk) 11:47, 6 April 2006 (UTC)[reply]

Some, e.g. Venezuela, do. —Nightstallion (?) Seen this already? 19:56, 6 April 2006 (UTC)[reply]
Hmm, well if there is no definitive rule I'll just asume the people "in the know" have made sure the right versions of the flags are used by now. I know I would find it wierd if the Norwegian state flag was used all over the place so I guess most such mistakes would have been weeded out by now, except we might not have a whole lot of editors from a microstate like San Marino for example so I figured I'd check. --Sherool (talk) 06:49, 7 April 2006 (UTC)[reply]

Usage for Personal Nationality

There are many uses of flags attached to personal names, e.g. World_Series_of_Poker#Main_Event_Overview. In these cases people have frequently used the construct
[[Image:Flag of the United States.svg|20px|American]] [[Steve Dannenmann]]
to produce "American Steve Dannenmann". Is there a way to produce the same effect using the templates that currently exist? Using the 'flagicon' template for the first part is feasable, except that the tooltip/alternate text would be 'United States' rather than 'American'. Is there a way to configure the tooltip? --Deadlock 12:47, 9 April 2006 (UTC)[reply]

should be US-American. Tobias Conradi (Talk) 12:24, 22 May 2006 (UTC)[reply]
That doesn't actually answer the question. Deadlock 16:03, 23 May 2006 (UTC)[reply]

Shorthand templates

What's the difference between the {{SWE}}, {{SWEb}}, {{SWEf}} and {{SWEh}} series of shorthand templates? And isn't there one which gives only the flag? -- Jao 21:41, 31 May 2006 (UTC)[reply]

AFAIK, b is for basketball, f for football, h for ice hockey, and {{flagicon}} gets you just the flag. —Nightstallion (?) 17:51, 5 June 2006 (UTC)[reply]

United Arab Emirates

United Arab Emirates in short should be EAU (use by FIFA code),or commonly UAE. But none of it create flag. Matt86hk talk 07:20, 4 June 2006 (UTC)[reply]

EAU is use by Panini. ISO-code is AE or ARE. All cannot create flagicon. Matt86hk talk 07:40, 4 June 2006 (UTC)[reply]
Same problem: Honduras (HON), Zambia (ZAM) Matt86hk talk 14:01, 4 June 2006 (UTC)[reply]

Using Diff't Image at Diff't Resolutions

The U.S. flag does not compress well to 20px or 22px. Instead of using the template I have manually replaced it a few times with a special 20px or 22px image of the flag that straightens its horizontal lines at such a small resolution. This would be a tedious process to do many times, not to mention highly inefficient. Would there be any way to automatically do this through the template? So that at the default 22px size the 22px image is loaded instead of the large image compressed to 22px?

Here's what I mean...

20 pixels: File:20px-Flag of the United States.png versus
22 pixels: File:22px-Flag of the United States.png versus United States – note that the latter, noticeably inferior image uses {{flagicon}}.

Any help would be greatly appreciated.

Uris 22:09, 15 June 2006 (UTC)[reply]

See also User talk:Uris#flagicon /wangi 22:30, 15 June 2006 (UTC)[reply]

Historical flags

I know a lot of people (on Olympics pages, for example) are quite picky about using historical flags. Could we make our flag templates use the #if syntax so that you could optionally specify a year, and choose an appropriate flag from it. This means that someone could, for the USA flag, put {{flag|USA|1942}} and the template could detect that the date is between 1912 and 1959 and therefore use the 48-state flag. I'd be willing to try to implement it if people think it's a good idea.Moszczynski 19:13, 23 June 2006 (UTC)[reply]

So basically, My thinking is it would look like this:
Code Result
[[{{User:Moszczynski/country flag alias DRC}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|2006}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|2002}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|1985}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|1968}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|1960}}|32px]]
[[{{User:Moszczynski/country flag alias DRC|1900}}|32px]]

Formatting help...

I'd like to add a &nonbreakingspace; between the flag and the country name, but I'm apparently not smart enough which of the numerous sub-templates I have to edit in which way to make that happen... —Nightstallion (?) 15:26, 3 July 2006 (UTC)[reply]

FIFA country codes

I was wondering if it would be a good idea to have flagFIFA templates for FIFA contry codes? Football (soccer) articles currently use templates such as {{GERf}}, {{GERf2}}, {{GERwf}}, {{GERwf2}}, etc. (see Wikipedia:WikiProject Football/National teams/Referencing templates) and as editors won't always update all four at the same time, I think it'd be better if they all shared a template. Also, the football articles currently seem to use a mix of FIFA and ISO codes. (They will use {{flagicon|GER}}, for example.) --StuartBrady (Talk) 15:44, 1 September 2006 (UTC)[reply]

Major code cleanup request

the current system for country and flag names templates are using an archane array system that is inefficient and may result in long list of included templates in an article (see InuYasha for example. This may be fixed by changing to an #switch construct in one template instead (example template: {{Country name alias}}), where it only need one template per type of resut wanted (full name, short name, image name etc...). This may also remove the need of grabbing the country name before grabbing the image name, as the image name may be grabbed directly from it's template. The major work needed is to compile the list of country names, and it's alternatives, you may start by using {{Country name alias}} wich is compiled from the data from ISO_3166-1, and will result in the name specified for the country on that page using one of the codes or the name of the country as parameter. When all this is done, all that need to be done, is to replacing the templates and get a bored admin to delete all obsolete templates lying around (a couple of hundred I think). AzaToth 20:45, 6 October 2006 (UTC)[reply]

Sounds OK. When I created the current implementation it was expected to be a temporary solution which used the current technology, and replacement with better technology is expected. The #switch implementation has several advantages. Are there technical problems with a #switch with hundreds of entries? Maybe w:Village Pump(technical) could check a sample. All the {{countryedit}} references would become obsolete so would require cleanout. (SEWilco 17:29, 27 October 2006 (UTC))[reply]
Don't do it. By turning it into one big #switch template you'll run into the Wikipedia:Template limits pretty fast on pages (lists) that contain a few hundred flags. See some related debate on Template talk:Length conversion. So for the time beeing at least the lesser of two evils still seems to be the current multi template solution. --Sherool (talk) 07:45, 13 December 2006 (UTC)[reply]
I'm not surprised. I wonder how Jimbo's wiki data proposal is coming along. (SEWilco 04:34, 14 December 2006 (UTC))[reply]
Actually, the specific "Template limits" above is a 2MB pre-include limit on the code (not the images). A test page with almost all country flags is presently "Pre-expand include size: 511749 bytes". So if the template code grows about four times larger than it presently is, such a ridiculously full page will have trouble. But few pages need all nations, much less their flags. A "Group of 21" page would not be as close to the limit. (SEWilco 07:02, 14 December 2006 (UTC))[reply]
Can you give examples of these lists? Many flags are 5KB or less and, even assuming all larger flags of 16KB, there would need to be about 128 flags for it to run into the limits. Would even List of flags run into problems here? Gallery of sovereign-state flags does not consist of templates, and List of flags too could be made into an image gallery, which I think would be more appropriate anyway. What lists would run into the template limits? —Centrxtalk • 05:33, 14 December 2006 (UTC)[reply]
It's not the size of the flag image, it's the total size of all transcluded text (the amount of data from other pages (templates) that must be loaded in order to render the page). On Wikipedia the limit is set to 2048000 bytes (2Mb) per Wikipedia:Template limits. The current "metatemplate" system weigh in at about ~240 byte, meaning you can transclude it some 8500 times on the same page before you start running into trouble. However if you put the code for 128-ish flags in one template it will be in the 30Kb range (a liberal estimate, considering you need lots of extra parser function code to obtain the same functionality), meaning you can suddely only transclude the template ~66 times on any one page before you hit the limit, and that is asuming there is no other transclution going on, stub templates, infoboxes, cite templates, navigation boxes and what not all count towards the same limit as well. To see what happens try calling for example {{Length conversion}} (a 23Kb template) about 90 times in a sandbox somewhere. --Sherool (talk) 07:19, 14 December 2006 (UTC)[reply]

protect?

this seems like a fairly high-risk template.. should it be (semi)-protected? Mlm42 09:03, 1 November 2006 (UTC)[reply]

alignment of flagcountry references in tables?

This code:

    {|
    |[[United States]]
    |{{flagcountry|USA}}
    |-
    |}

yields

United States  United States

which, at least on my browser (IE6), has the two instances of "United States" slightly misaligned.

I suspect that what is going on is that (a) the image's top is being aligned with the right-hand text's top, and that (b) the right-hand table entry is (because of the image) slightly taller than the left, and they're being aligned on either the middle or the bottom.

Is there any way to fix this? It makes tables with flagcountry entries look off kilter.

Thanks Jordan Brown 08:48, 6 December 2006 (UTC)[reply]

Country flag alias Pakistan: Bordered or not?

Moved from user talk:Ligulem:

Greetings Ligulem

I notice that you've protected {{Country flag alias Pakistan}}. As soon as I realized something was wrong with the new file, I contacted the uploader and the file seems to be ok now. Would you mind updating so the file used becomes Image:Flag of Pakistan (bordered).svg instead? Regards. Valentinian (talk) / (contribs) 00:49, 6 December 2006 (UTC)[reply]

I vaguely remember having seen some disagreement over using bordered flags in the past. What is the consensus? Should this change be made or not? As being the protecting admin, I will fullfill the request of Valentinian if there is consensus to do this (or lack of opposition). --Ligulem 09:44, 6 December 2006 (UTC)[reply]
The problem seems to have been that these images were created in batches rather than all at once. Glancing at List of IOC country codes and ISO 3166-1, it seemed rather apparent to me that people have shifted to these images when they became available, so I have lately been updating a few "missing" entries from the list without any complaints. The most obvious cases missing were Pakistan, Bahrain and Qatar. These images are not intended for use in article space, but they are very useful in lists using the {{flagicon| }} feature where the flags of Japan, Cyprus etc. used to stick out without any form of bordered feature. Same applies to Pakistan due to the white stripe. Couldn't this be solved by simply using the {{border| }} feature? Sure, but the lists often become a jumbled mess with one editor adding the border manually and another editor abstaining / forgetting. Examples with both solutions used in the same list are not pretty. People often forget that if a list of flags is composed of both bordered and non-bordered versions, flags to which a border is manually added should be sized 2px smaller than the other images since the border takes up 2x1 pixel by itself. I must admit to be a bit puzzled why this picture in particular needs protection compared to many other flags that are more controversial or compared to high-use material like the stub templates that are almost never protected. I have never seen any complaints when stub templates were upgraded to the bordered versions. Regards. Valentinian (talk) / (contribs) 14:46, 6 December 2006 (UTC)[reply]
Done --Ligulem 22:00, 15 December 2006 (UTC)[reply]

11 December 2006 icons broken

If you notice that flag icons have vanished, it may be because User:Centrx has edited a protected template which is part of the flag icon tools. Some flag icons have been broken. The user claims there was discussion in numerous forums, although apparently not here. (SEWilco 18:36, 11 December 2006 (UTC))[reply]

The change has been reverted. (SEWilco 19:24, 11 December 2006 (UTC))[reply]

So when is this template mess going to be fixed? There are four layers of these templates, starting from the level of {{USA}}; this is not necessary to be within template expansion limits. —Centrxtalk • 09:24, 20 December 2006 (UTC)[reply]

Could you explain: "this is not necessary to be within template expansion limits". I don't understand that part. --Ligulem 12:12, 20 December 2006 (UTC)[reply]
See #Major code cleanup request. A reason for needing templates within templates is that there cannot be more than 2MB of templates on a page (though to me this seems like a limit that could never be reached with a reasonable use of flags on an article). This limit, however, would only require one level of templates within templates, not three. —Centrxtalk • 02:04, 24 December 2006 (UTC)[reply]
Replacing this template system with some fat switch(es) would be a bad idea (see Sherool's post further up). The current system is complex but technically effective and quite efficient, especially with regards to Wikipedia:Template limits. It is also extensible, which switches aren't (you can add new templates – with a switch you have to edit the template containing the switch and adding cases). The vandalism problem that comes with having many templates can be addressed by protecting. The complexity by documenting/explaining. --Ligulem 00:41, 25 December 2006 (UTC)[reply]
A "fix" requires a technology which you find acceptable. Maybe someone is working on the "data" concept which Jimbo mentioned over a year ago. (SEWilco 16:50, 20 December 2006 (UTC))[reply]

Ideas for reworking

(Inserted section title "Ideas for reworking" right above --Ligulem 09:44, 4 January 2007 (UTC))[reply]
  • Given that these templates are sometimes called hundreds of times on a single page I agree that converting to a few switches (or indeed just one large template) would quickly exceed the 2MB transclusion limit. However, another possibility occurs to me. Currently the 'AUS' template calls 'Country alias AUS' to set "Australia", 'Country flag alias AUS' to set "Flag of Australia.svg" and 'Country label alias AUS' to set... "AUS". Plus a couple of intermediate templates to define the format of the final output. Why couldn't 'AUS' instead set the parameters 'name=Australia', 'flag=Flag of Australia.svg', and 'label=AUS' and just pass those to the format template? The total transcluded size is virtually the same (indeed, possibly smaller since the parameter names are shorter than the template names), but we've removed three extra templates for every country. A ridiculous amount of work to do, but it would vastly decrease the number of templates involved. The only other options are to use fewer flags on a page (in which case the #switch method would be workable) or, as Ligulem said, someone has to track down and protect all of these templates. --CBD 00:49, 3 January 2007 (UTC)[reply]
  • Could you please post the exact new code you propose and the name of the template this code is for? I would like to know the details before trying to understand and commenting. Thanks :-). Per the protecting: see my admin log. I've worked through them a bit by starting from main page links and using the new transcluded protection status display feature (bugzilla:8392). --Ligulem 10:18, 3 January 2007 (UTC)[reply]
  • See Template:Xyzistan for an example of how the method I describe would work. That calls an 'action' template (just as Template:Country does) which currently defaults to User:CBDunkerson/Sandbox4... which is a reworking of Template:Country_flagcountry designed to work with supplied parameters. If the 'Xyzistan' template were called with an 'action=flag' parameter set then another template, parallel to Template:Country_flag, would be called and so on for the various options supported by the current template... I only built the one example for now. If different aliases were desired a Template:XYZ or Template:Democratic Republic of Xyzistan could be set up the same way or as just a redirect to 'Xyzistan'. Basically this works the same as the current setup except all of the 'Country alias', 'Country flag alias', 'Country label alias', and 'Country shortname alias' templates are removed and replaced by parameters in the top level templates... which also combine the functionality of things like Template:USA and Template:Country. Roughly the same transcluded size... just ALOT fewer templates. Easily less than 25% of what the current system requires. --CBD 01:25, 4 January 2007 (UTC)[reply]

CBD, I'm still in the phase of "need to understand more". What I don't see from your proposal is, what should for example happen to template:flagicon. I once did a dissection for the call "{{flagicon|USA}}", which goes like this:

{{#if: {{{1|<noinclude>-</noinclude>}}} |
{{country_flagicon|{{{1}}}|size={{{size|}}}}}
}}

So "{{flagicon|USA}}" (United States) is

{{#if: USA |
{{country_flagicon|USA|size={{{size|}}}}}
}}

which is the same as

{{country_flagicon|USA|size=}}
[[Image:{{country flag alias {{{1}}}}}|{{#if:{{{size|}}}|{{{size}}}|22x20px}}|{{country alias {{{1}}}}}]]

So "{{country_flagicon|USA|size=}}" is

[[Image:{{country flag alias USA}}|{{#if:||22x20px}}|{{country alias USA}}]]

which is the same as

[[Image:{{country flag alias USA}}|22x20px|{{country alias USA}}]]

So "[[Image:{{country flag alias USA}}|22x20px|{{country alias USA}}]]" is

[[Image:Flag of the United States.svg|22x20px|United States]]

--Ligulem 10:08, 4 January 2007 (UTC)[reply]

BTW, what I don't understand from this dissection is: what's the purpose of "|United States" in "[[Image:Flag of the United States.svg|22x20px|United States]]", which comes from "|{{country alias {{{1}}}}}" in template:country_flagicon? Could that part of template:country_flagicon not simply be removed, thereby eliminating the dependency from template:flagicon to the country alias X templates? --Ligulem 10:27, 4 January 2007 (UTC)[reply]
Stupid me: this is the caption text supplied for the image's alt attribute (per Wikipedia:Extended image syntax#Syntax for images with no automatic caption or formatting). Apologies for posting before researching... --Ligulem 10:42, 4 January 2007 (UTC)[reply]
BTW 2: template:country_flagicon uses only parameters {{{1}}} and {{{size}}}. What is the purpose for template:flagicon feeding parameter {{{2}}} with the same value as {{{1}}} to template:country_flagicon? --Ligulem 10:52, 4 January 2007 (UTC) I've changed the template and adjusted my dissection above. --Ligulem 16:47, 4 January 2007 (UTC)[reply]
Ok, to answer your last question first... I agree that the '2' parameter doesn't do anything on 'flagicon' and expect that it was copied from similar variants where the flag image is followed by an abbreviation code. I've noticed a few little things like that which could be 'tightened up' in the current system.
As to the change I am proposing... instead of a call to {{flagicon|USA}} the user would now invoke {{USA|action=flagicon}}. The 'USA' template would be the same layout as my 'Xyzistan' template above (or a redirect to such a template). It would thus look something like;
{{{{{action|User:CBDunkerson/Sandbox4}}}
|flag=Flag of the United States.svg
|size={{{size|22x20px}}}
|alias=United States
|name=United States
|shortname=United States
|label=USA}}
I think some of the whole alias/name/shortname redundancy can probably be removed, but I haven't analyzed all the sub-templates yet to verify that. The 'action' and other named parameters could also probably be changed to just '1', '2', '3', et cetera to simplify and shorten the template calls. Anyway, since 'action' (or '1') is set to 'flagicon' in this case we would call a 'flagicon' template... which would be essentially the same as the current Template:Country_flagicon except that it would take the 'flag' and other parameters above instead of looking up the contents of template:country flag alias USA and the like... just as User:CBDunkerson/Sandbox4 is a reworking of Template:Country_flagcountry to use the parameters rather than sub-templates. Thus, under the proposed system each of the 'Template:Country_<action>' templates would be rewritten to accept parameters instead of looking up sub-templates. We could probably even keep the same template names and temporarily recode them to accept either format to make the transition easier. --CBD 12:47, 4 January 2007 (UTC)[reply]
Thanks. Ok. So your point is that flagicon wouldn't be used anymore.... So your idea is to package all data about "USA" into a single data template called "USA" that can be combined with a set of "data using" or "action" templates. Not bad (this is a recurring template pattern [2] :-). Give me some more time to ruminate this. One point: I do have a bit a strange feeling about the "size" parameter in your USA data template. This is a "feed through" to the action template as I understand it. So the default value "22x20px" should be in the specific "action" template not in the data template (?). Maybe we can find some better way on this corner. Need to think about this more... --Ligulem 13:26, 4 January 2007 (UTC)[reply]
Just for the record: The current system does have the advantage, that if new "actions" that require additional data-parameters (lines in CBD's "USA" template) are added, these parameter values can be added to the wiki by just creating additional templates (containing these values alone). So the existing system is "better" with regards to extensibility. With CBD's "all data per country in one template" approach, all data templates must be changed (example: say we create a new action that requires a "population" parameter. "population" would have to be added on all USA, etc. templates). However that's exactly one of the drawbacks of the current system as well: an abundance of templates. Sigh. --Ligulem 13:43, 4 January 2007 (UTC)[reply]
Well, the 'flagicon' template could be kept and just changed around to call the appropriate 'country specific' template with 'flagicon' as the 'action' parameter. That'd allow backwards compatibility with existing links, but be rather redundant... though actually having both 'flagicon' and 'country' currently is similarly redundant. As to '22x20px'... it needs to be set in the top level parameter to avoid being blanked out. That is, if the user did not set a 'size' parameter then Template:Xyzistan would set parameter size to blank... which is not the same as unset. The lower level templates would then use that 'blank' value and ignore the default since a 'value' (of 'blank') WAS set. Finally, on extensibility... having to add one new 'population' template for each alias of each country would probably be about as much work as adding a 'population' parameter to each existing template for each non-redirect alias of each country. The only way to get rid of THAT 'mass edits to add new feature' problem would be to go to a 'switch' based system. --CBD 14:08, 4 January 2007 (UTC)[reply]

Quick stupid question: If I look at the articles, I see all these small icons. So most uses of this template system here is displaying a small flag icon on an article page. So what do we need to know to display such a small icon? We need a common size and the name of the image for the flag and the alt text. So why don't we simply create a template:smallflag Italy, containing:

[[Image:Flag of Italy.svg|{{smallflagsize}}|Flag of Italy]]

and a template:smallflagsize containing "22x20px" and replace the current calls on articles for small flags? I bet this would cover 90% of current usage taking load off this current system. --Ligulem 14:23, 4 January 2007 (UTC)[reply]

Something like that would be fine with me. People would have to manually create their Italy and ITA links... resulting in those and the image caption text not always being consistent or correctly disambiguated, but not TOO big a deal. Even some of that could be dealt with by putting one or two options into the template to display the links. All of the complexity of the current system comes from standardized formatting for several different display options... if that was all or mostly handled manually it'd be alot simpler. BTW, the 'smallflagsize' template wouldn't really be needed in the example above... just code the 22x20px into the 'smallflag Italy' template directly. --CBD 00:05, 5 January 2007 (UTC)[reply]
You've worked your way back to the hardcoded templates for each abbreviation which existed before these the flag templates existed. Did you read the original Village pump discussion? It is archived on this page.[3] Changing the size would then require that all the hardcoded templates be identified and edited; the size already had to be adjusted once in the templates. (SEWilco 03:48, 5 January 2007 (UTC))[reply]
If global size changes are a desired capability then Ligulem's idea of a separate 'smallflagsize' template for just that value would probably be the best way to go. I think it is really a matter of determining what capabilities are desired / most needed. I would describe the scope of the current system as 'four templates or redirects per country alias plus two templates per display configuration'. I have been suggesting that the same capabilities could be achieved with 'one template or redirect per country alias plus one template per display configuration'. Ligulem took out all the text formatting options to get it down to 'one template or redirect per country alias plus one image size template'. For either of the latter two options the big gain is in losing the multiple templates for each alias. I think that would be much more managable. The only way to reduce it further would be to force users to always call the template with the same alias or add big 'switch' statements that would cause problems with mass transclusions. --CBD 09:56, 5 January 2007 (UTC)[reply]
SEWilco, I've read that discussion now. The current system is technically ingenious and its not bad for the servers (as long as we don't have a massive vandal attack editing all templates within the same few minutes). Thing is, people do have problems to understand the current system and three or four times 1'500 templates for 1'500 flags is a lot. However, I don't think we should try to reduce the number of templates at all cost. Per CBD's "data" template: I've thought about this and slept a night over it. The more I think of it the more bad feeling I have about it. CBD's USA example above here is rather complicated as well (compared to the existing system). The problem I think I'm able to articulate at the moment about it is, that I fear it is difficult for people to maintain all 1'500 data templates consistent (we currently have about 1'500 different flags in the current system [4]). Also, as already noted, I'm especially not pleased about the size handling in CBD's data template. Per the "quick stupid" proposal by me, that was a radical attempt at a minimalistic solution. Maybe we could include a size parameter to make it a little bit more versatile:
[[Image:Flag of Italy.svg|{{{size| {{smallflagsize}} }}}|Flag of Italy]]
But then, we start having the same "keep it consistent over 1500 templates" problem again. People will copy these templates when they want a new flag. If someone introduces a slight variant of that, uniformity is lost again. Today, people copy things like template:USA which currently is {{country|flagcountry|United States}} and they get redlinks for the missing data templates and fill the missing data in (Demonstration: throwaway Template:LigulemLand, which shows the redlinks for the missing templates). Besides creating 4 templates for a single flag ({{LigulemLand}}, {{Country flag alias LigulemLand}}, {{Country alias LigulemLand}} and {{Country shortname alias LigulemLand}}), a good solution to keep everything consistent, including the names of the created templates. In short: I'm not sure what to do with the current system. --Ligulem 10:52, 5 January 2007 (UTC)[reply]
Or when they create a new flag they fill in the missing data in countryedit. (SEWilco 21:49, 5 January 2007 (UTC))[reply]
Template:Countryedit
Ahh. Ok. A factory tool for creating new flags. Nice technical solution. --Ligulem 00:45, 6 January 2007 (UTC)[reply]
I'm not sure I see the consistency problem. If the top level template JUST passes parameters to another template then when people copy that to a new country any 'changes' they make would have to be outside the template call (which is possible under any structure) OR would require updates to the sub-template... which is shared by all the other countries and thus any changes to it will be reflected in the others and can be reviewed for consistency / consensus. If all the formatting code were in the top level as per your suggestion then each template could be formatted independently. The 'size handling' can be done with a sub-template in ANY of the systems (including the current one) if that is preferred. Finally, after looking at the various 'action' formats I'm thinking that it might be possible to build a fairly compact single sub-template to handle all of them... which would mean one template/redirect per country alias and then just one other template for setting the default size and formatting the output. Only problem would be keeping it small enough to allow mass transclusion, but I think it is doable. --CBD 11:40, 5 January 2007 (UTC)[reply]
I was thinking about errors like "|shortnam=United States" instead of "|shortname=United States" or missing parameters because someone deleted it and somone else copied the error. Whatever. The default size should not be hardcoded, so at least let's have:
{{{{{action|User:CBDunkerson/Sandbox4}}}
|flag=Flag of the United States.svg
|size={{{size|{{defaultflagsize}} }}}
|alias=United States
|name=United States
|shortname=United States
|label=USA}}
or something (I don't care about the name of the templates). Maybe a test implementation could help to gather some real experience? For example, we could copy European Union to Wikipedia:WikiProject Flag Template/tests/European Union and implement the flags for that page using CBD's data/action template system (duly marking the new templates as not released for general use on articles yet). --Ligulem 12:48, 5 January 2007 (UTC)[reply]
A while ago, Jimbo Wales wanted a data tool which could store information such as the capitol of a country. Anyone know if something (Wikidata/WikiTextrose?) is close to going live? (SEWilco 21:53, 5 January 2007 (UTC))[reply]
I haven't heard anything, but I doubt it is coming any time soon. Single logon and stable versions are the two big projects currently in the pipeline. --CBD 23:08, 5 January 2007 (UTC)[reply]

Sub-templates

Currently this system can access the following 'action' subtemplates:

  1. codeISO - Virtually unused. Output format = 'XYZ'
  2. flagISO - Virtually unused. Output format = Xyzistan XYZ
  3. flagIOC - Virtually unused. Output format = Xyzistan at the 2004 Summer Olympics XYZ
  4. flag - Output format = Xyzistan XYZ (optional 'name' parameter to change link display)
  5. flagcountry - Output format = Flag of Xyzistan Xyzistan (optional 'name' parameter to change link display)
  6. flagcountrycat - Virtually unused. Output format = Same as above plus adds to Category Xyzistan (optional 'name' parameter to change sort key)
  7. flagicon - Output format = Xyzistan
  8. infobox - Virtually unused. Small table with 'data' subtemplates that do not appear to have been created.
  9. name - Virtually unused. Output format = Xyzistan

Leaving out the six options that aren't really used that leaves 'flag', 'flagcountry' and 'flagicon'. The only differences between these are that 'flagicon' does not provide a link to the country article, 'flagcountry' uses the image tooltip 'Flag of <place>' rather than just '<place>', and 'flag' displays the abbreviation (e.g. 'XYZ') by default instead of the name (e.g. 'Xyzistan') on the link. I'm assuming that the inconsistency on the image tooltip isn't intentional/relevant and the only real formatting variation here is the link to the country article at the end... either don't show it, default the text to 'XYZ', or default the text to 'Xyzistan'. All of which could easily be handled with a single parameter. --CBD 13:07, 5 January 2007 (UTC)[reply]

Many thanks for the list. Per the "image tooltip": this is the "alt" parameter for the <img> html element, which is useful for users that turn off pictures in their browsers or for users that use a screen reader like user:Graham87. For example, reading "Flag of Italy" as the alt text makes probably more sense than just "Italy". --Ligulem 13:21, 5 January 2007 (UTC)[reply]
Ok, I put the tooltip in with 'Flag of', combined it all in to one template (Currently at User:CBDunkerson/Sandbox4), and set up my fictional country of 'Xyzistan' as a test case:
  1. {{XYZ}} = Template:XYZ
  2. {{XYZ|icon|size=30px}} = Template:Xyzistan
  3. {{Xyzistan|label}} = Template:Xyzistan
  4. {{Xyzistan|Democratic Republic of Xyzistan}} = Template:Xyzistan
The final template at User:CBDunkerson/Sandbox4 is still fairly compact. I didn't create a separate 'smallflagsize' template because the size is now set only in this single template for all uses. Thoughts? --CBD 13:53, 5 January 2007 (UTC)[reply]
Off topic: I think I'm signing off here and leave this to the real experts. Cheers, --Ligulem 14:39, 5 January 2007 (UTC)[reply]
I've been bold and put this into practice as Template:Flag icon and converted Template:USA (probably the most widely used example of the present system) to call that. The transcluded size in this case is actually smaller and the system requires transclusion of two templates instead of six. The only significant 'drawback' (other than the work needed to retool everything) I see is that things like Template:United States are already in use. However, if we settled on a standard of making the base template the three letter ISO code (almost all of which seem to have templates in the existing system) and convert all other existing 'aliases' to a format of '<alias> flag' (e.g. Template:United States flag) as redirects to the default three letter code then I think this should be workable. --CBD 15:07, 5 January 2007 (UTC)[reply]
Duh. Ok. Just noting that after the first call of {{flagicon|USA}} has been changed to {{USA|icon}} (and we don't know if that already has happened somewhere by the time I write this), your edit to template:USA can no longer be reverted without breaking articles. Let me know if I shall fire up my MWB... (awaiting consensus). --Ligulem 16:58, 5 January 2007 (UTC)[reply]
Somehow I'm not too worried. After all, other than people who have been following this thread who exactly would even think/know to DO that? As the output is identical, chances are that no one else has even noticed the change yet. I'm tempted to just go ahead and convert all variants of the U.S. flag over, but waiting on any comments about potential drawbacks to this system. --CBD 20:21, 5 January 2007 (UTC)[reply]
Conflicts such as {{United States}} were referred to in the original Village Pump discussion, and is why the "flag" and "country_" prefixes were selected. It's just not safe to restrict the name of a country to being a magic word. (SEWilco 06:46, 6 January 2007 (UTC))[reply]

Template:flag icon comparison

So by using the changed template:USA, which uses the new template:flag icon (note the space), we could now do:

New call Old call(s) Remarks
{{USA}} =  United States (unchanged) {{USA}} =  United States

{{country|flagcountry|USA}} = Template:Country data flagcountry

{{USA|icon}} =  United States {{flagicon|USA}} = United States
{{USA|icon|size=40px}} =  United States {{flagicon|USA|size=40px}} = United States
{{USA|label}} =  United States {{country|flag|USA}} = Template:Country data flag
{{USA|Some special link text}} =  United States {{country|flagcountry|USA|name=Some special link text}} = Template:Country data flagcountry

Feel free to edit the above table. --Ligulem 23:47, 5 January 2007 (UTC)[reply]

  • An invariant. Calls {{USA}} wouldn't have to be changed under CBD's system. Maybe I simply shouldn't have added this row :-). Sorry for the confusion. --Ligulem 09:55, 7 January 2007 (UTC)[reply]
Above I changed "flagcountry|United States" to "flagcountry|USA" so all the same name are used. (SEWilco 03:51, 6 January 2007 (UTC))[reply]

Let's try another one. (SEWilco 03:51, 6 January 2007 (UTC))[reply]

New call Old call(s) Remarks
{{United States of America flag}} = Template:United States of America flag {{United States of America}} = Template:United States of America

{{country|flagcountry|United States of America}} = Template:Country data flagcountry

{{United States of America flag|icon}} = Template:United States of America flag {{flagicon|United States of America}} = United States
{{United States of America flag|icon|size=40px}} = Template:United States of America flag {{flagicon|United States of America|size=40px}} = United States
{{United States of America flag|label}} = Template:United States of America flag {{country|flag|United States of America}} = Template:Country data flag
{{United States of America flag|Some special link text}} = Template:United States of America flag {{country|flagcountry|United States of America|name=Some special link text}} = Template:Country data flagcountry

Let's try {{United States}} all by itself. (SEWilco 03:53, 6 January 2007 (UTC))  United States[reply]


Hmm. CBD's data templates can be named to "SOME PREFIX XXX". For example "Flagdata USA". BTW the current system didn't stop people from using template:USA. The "discrepancy" template:USA / template:United States already exists now. I assume people won't stop using that. As I understand it, template:USA isn't even a part of SEWilco's flag template system, so changing template:USA and adding template:flag icon doesn't touch SEWilco's flag template system. But I admit, replacing calls {{flagicon|USA}} with {{USA|icon}} would, and this would introduce more calls into the naming discrepancy SEWilco is criticizing and which his system solves. Couldn't that problem on the CBD system be addressed by using template:Flagdata USA and creating a front end template:flagicon2 or something? (Don't bite me about this naming, we could copy the contents of the recently created template:flag icon to template:flag icon formatter and then reuse the name "flag icon" for the CBD front end. So the updated replacement would then be:
CBD style call: {{flag icon|USA}}, which replaces the SEWilco style call: {{flagicon|USA}}. --Ligulem 08:44, 6 January 2007 (UTC)[reply]
SEWilco, ONLY the 'USA' template has been set up in the new format... ergo, of course the examples above do not do anything yet. However, there is nothing preventing us from setting those up... which would be one template for each alias instead of the current three or four. As I said previously, the problem with some of the templates, like 'United States', currently being in use could be fixed the same way it is in the current system... by using something like 'United States flag' as the standard name. If we always add 'flag' to the end (or front, or some other term) then there should not be much overlap. On the existing 'flagicon' template... when all the countries are set up that could just be re-coded to call the new 'flag icon' template with the parameters in the right place... all of the existing calls to 'flagicon' could be left completely unchanged. --CBD 11:13, 6 January 2007 (UTC)[reply]
Just a minor point: If we use common prefixes instead of suffixes (for example "Flagdata United States" instead of "United States flag)", listing all templates would be easier. For example, if we would use the common prefix "Flagdata" – as in template:Flagdata USA – listing all flag data templates could be done by using Special:Prefixindex with this query. This would be closer to the style of SEWilco's current system. Of course, a suffix naming system can as well be enumerated by adding the templates to a category. Another even smaller point is that templates using the same prefix are listed together in the edit mode of an article. See the list of transcluded pages here. --Ligulem 12:56, 6 January 2007 (UTC)[reply]
Makes sense. I was going with the suffix because "United States flag" sounds ok as a name. On prefixes, I'd prefer to keep it short given that this would be something the user has to type in for each call... {{flagdata United States}} would work, but is there a reason not to use {{flag United States}}? Of course, if we keep the 'multiple entry points' of the current system's Template:Country, Template:Flagicon, Template:Flag, et cetera then the prefix could be automatically add in the code of those (see other comment below for more info on this). --CBD 09:33, 7 January 2007 (UTC)[reply]
I added a Template:United States of America flag redirect to Template:USA and updated the table above to show how this is intended to work. The 'United States' template would instead be Template:United States flag. There is no problem of 'name overlap' here... the same system of using prefixes/suffixes employed by the current system works just as well for the proposed. --CBD 11:37, 6 January 2007 (UTC)[reply]
I'm not sure I understand the need for Template:Flagdata United States, etc. I'm of the opinion that we create templates such as Template:USA that calls on Template:Flag icon, and leave it at that. The reason we're revisiting the issue is that the list of transcluded templates is already extremely long and the current system is too complicated. Adding redirects for every country, and essentially creating more work and a more complex system seems contrary to the goals of these discussions. I know some people are concerned about usability, people are smart enough to figure out that all flags are using a three-letter, and when they try to use something different, it obviously won't work. There could a nicely laid-out directory of the templates, and that would enable everyone to look up what template to use. Template redirects make things more complicated, and they make the list of transcluded templates longer. --MZMcBride 20:48, 6 January 2007 (UTC)[reply]
SEWilco can probably better explain the motivation behind the current naming system. But if you look at this section of Andre Agassi, you'll see calls of {{flagicon|USA}}. These would have to be replaced by {{USA|icon}} using CBD's pure proposal. Now that's fine, because template:USA is already in use as a flag template and can be reused for CBD's system because the existing parameterless calls {{USA}} are compatible with CBD's version of the template. Thing is, there is no uniform naming system when using the "direct" templates like template:USA. So it could be that you would have to replace the fictive {{flagicon|Ligulemland}} with {{Ligulemland something|icon}} if fictive template:Ligulemland happens to have already been taken for a list of the fast food restaurants. This is the case for template:United States, which was already taken for a navigation box. The example of United States is somewhat lame as template:USA can be used instead. One of the reasons for the current admittedly difficult to understand system is – as I understand it – to also provide some uniform naming system. So I guess it was probably the original intent to replace calls to template:USA with {{country|flagcountry|USA}} or at least provide {{country|flagcountry|United States}} for the already lost template:United States (a navigation box). I hope this makes some sense. Apologies if I might have increased the confusion. --Ligulem 01:00, 7 January 2007 (UTC)[reply]
You're repeating the process which created the flag templates. The USA template (history) existed before it used the flag templates. The existence of the numerous differing flag definitions caused problems. The "country_" prefix was chosen for the data template array for the same reason you realized, so as to group them together alphabetically. The different aliases for countries were created because this is an editor's tool and editors can't be expected to remember the proper incantations for all countries so they have some common choices. If people want to replace {{USA}} with a more formal tool that's their choice; I am not aware of anyone examining whether {{USA}} is obsolete or not. This flag project specifically states that better technology is expected to replace this mess, and I consider Flagicon|USA to be a marker for future replacement by the better tool. Examine the characteristics of this tool and figure out if you're talking about a better tool. (SEWilco 03:01, 7 January 2007 (UTC))[reply]
On the matter of converting {{flagicon|USA}} calls to {{USA|icon}}... again, that wouldn't really be required if we didn't want to do it. Once all the templates and redirects were set up the 'code' of Template:flagicon could be retooled to something like {{flagdata {{{1}}}|size={{{size|}}}}}... allowing all the existing calls to continue working. It'd mean an extra template transcluded for those calls, but still have less of that than the current system. --CBD 09:33, 7 January 2007 (UTC)[reply]


Format template

Instead of thinking of a 'smallflagsize' template, consider thinking of a 'flagformat' template. It might have only the size, but it might have other flag format fields. A common use of templates is consistent formatting, and perhaps the formatting can be defined in one place. (SEWilco 21:40, 5 January 2007 (UTC))[reply]

See Template:Flag icon... which is exactly what you describe above; a single template for all the formatting options covered by the current structure. Examples of its use can be seen in the section immediately above with the various 'Xyzistan' links. --CBD 23:08, 5 January 2007 (UTC)[reply]
If we were able to find a way to implement image redirects, either through javascript or a change to MediaWiki, these problems could be eliminated. You could have the standard Image:Flag of Australia.svg, but then also have redirects from Image:Flag of AUS.svg and Image:Flag of Commonwealth of Australia.svg, and all other variants, and then a template could simple use [[Image:Flag of {{{1}}}.svg|22x20px|{{{label|{{{1}}}}}}]] and it would solve the problem of the number of templates altogether. You would have a single template that could be used for any flag. So, are there any thoughts on a way to implement image redirection?
By the way, after reading the discussion above, I think using the system with country codes and having 1500 individual templates is too complicated, and should only be done if there would be a dedicated bot that would watch all of the templates and check for uniformity and be able to change all the templates en masse whenever changes across the flags were desired. --MZMcBride 23:59, 5 January 2007 (UTC)[reply]
CBD's template:flag icon would reduce the number of templates from currently three times 1500 (considering the typical usage of the current system) to just 1500. All data for a specific flag would be kept in a single data template (example: template:USA) instead of having three data templates per flag with the current system. The formatting algorithm is stored in a single place at template:flag icon. --Ligulem 00:18, 6 January 2007 (UTC)[reply]
OK, that sounds pretty reasonable. Though the image redirection, if ever possible, would really reduce it to one template, which beats 1500 and 1500*3. I've been involved in the discussion on the technical village pump about flag icons, and I'm just looking for any way to reduce the number. So, an implementation of CBD's idea sounds great. --MZMcBride 00:29, 6 January 2007 (UTC)[reply]
What is the meaning of the reference of 3*1500? The first mention of 1500 says there are 1500. (SEWilco 03:56, 6 January 2007 (UTC))[reply]
Ligulem mentioned that it currently requires about three templates per flag (Country flag alias, etc.) and that 1500 templates would be better than "three times 1500" templates. --MZMcBride 04:05, 6 January 2007 (UTC)[reply]
Ah. So if the "image redirection" ever appears, that would replace perhaps 1500 templates with 1500 image redirections. Minus the 300 or so actual images. (SEWilco 06:39, 6 January 2007 (UTC))[reply]
You're "looking for any way to reduce the number". So your only goal is a smaller number. Which features are you willing to sacrifice? (SEWilco 06:51, 6 January 2007 (UTC))[reply]
If we can reduce the number of templates, that would be fine. I don't think we need to "sacrifice" much. Can't we have one data template instead of three (or more) per flag? --Ligulem 08:50, 6 January 2007 (UTC)[reply]
Well, which of the features of the current system do you want to keep and which do you want to change? (SEWilco 03:07, 7 January 2007 (UTC))[reply]
CBD's proposal reduces the number of templates and the complexity of the current system. So that's an improvement. So if there aren't any objections against CBD's proposed change, we can implement it as soon as we have consensus. It's as simple as that. What are the features of the current system? Which features would "break" with CBD's simplification? --Ligulem 10:14, 7 January 2007 (UTC)[reply]
I don't think anyone was looking to change the features at all. My only goal was to reduce the number of templates transcluded so it'll be easier to do protections/unprotections when articles with these flags appear on the Main page... and so people might stop doing the WP:AUM dance. My position is that I think we can replicate the existing functionality with fewer total templates, fewer templates transcluded per call, and a smaller transclusion 'footprint'. The 'data array' approach was solid, but parserfunctions are a 'new' (relatively) technology which should allow the same capabilities in a more compact form. Still not a 'final' / 'perfect' solution by any means, but possibly worth implementing. --CBD 09:42, 7 January 2007 (UTC)[reply]
SEWilco, the whole thing could be done as a single template for all countries with a big 'switch' statement, but that would impose a lower limit on the number of flags per page so we didn't do that. Which features do you think are sacrificed by the proposed system? I tried to set it up so that it can retain all the existing capabilities... and even all the existing template calls in the articles if we don't want to convert those. --CBD 11:26, 6 January 2007 (UTC)[reply]

Changing USA flag calls

Ok. So now we have CBD's template:USA as discussed above. Can we now put this into use on the articles and go orphanning Template:Country alias USA, Template:Country alias United States, Template:Country flag alias USA, Template:Country flag alias United States, and Template:Country shortname alias USA for a start? Can we now replace the calls as shown in the table below?

New call Old call
{{USA|icon}} =  United States {{flagicon|USA}} = United States
{{USA|icon|size=40px}} =  United States {{flagicon|USA|size=40px}} = United States
{{USA|label}} =  United States {{country|flag|USA}} = Template:Country data flag
{{USA|Some special link text}} =  United States {{country|flagcountry|USA|name=Some special link text}} = Template:Country data flagcountry

I say yes. The new system uses less templates and reduces the complexity. Any objections to put this into use for the USA flag now? I'm volunteering to do this, with the help of my WP:AWB fork (no bot run, manually checking every diff before saving). --Ligulem 10:38, 7 January 2007 (UTC)[reply]

What are you proposing? First list which features of the current system you're willing to keep and which you're willing to get rid of. (SEWilco 16:45, 7 January 2007 (UTC))[reply]
This is a trap question right? I think my proposal is clear. And the motivation has been discussed. --Ligulem 17:11, 7 January 2007 (UTC)[reply]
To give a specific example: on Andre Agassi, I would replace all calls of {{flagicon|USA}} with {{USA|icon}} (sandbox edit). The resulting page would no longer use Template:Country alias USA and Template:Country flag alias USA. It would instead use template:USA and template:flag icon. The latter would be shared as soon as other flags have been converted. But I'm only asking for USA at the moment. As a first step. --Ligulem 17:37, 7 January 2007 (UTC)[reply]
No, it is not clear what you are proposing. The announcement which you put on several templates does not make clear that you are only referring to the "USA" usage, as opposed to using "USA" as an example of a template call.[5] [6] [7] In order to orphan Template:Country flag alias United States you'll also replace things like {{flagicon|United States}}, requiring "USA" for all calls. You also aren't listing which features of the current system you'll affect and which you won't affect. Perhaps you should ask in the talk pages of Andre Agassi and several other pages which you'll affect. Such as Chicago Cubs, Formula One, List of terrorist incidents, Organization of American States, Tour de France, United Nations Security Council. (SEWilco 19:30, 7 January 2007 (UTC))[reply]
Again... so far as I can see all currently used features will be supported. If there is some capability you think isn't covered by Template:Flag icon please say what it is and we can look at it. If you think the current configuration has advantages over the proposed please say what those are and we can discuss them. You mention 'USA' only being allowed, but Ligulem had already proposed 'flagdata United States' (though I might prefer the shorter 'flag United States') for variants other than the three letter codes. Also, again, I think that all current template calls in Andre Agassi and the other pages you list could be left completely unchanged - by redoing {{country}}, {{flagicon}}, {{country flagcountry}}, and so forth as calls to the appropriate country template... basically just a matter of reshuffling the parameters passed in, as demonstrated in one of my previous comments. If Ligulem is offering to do the work of converting them all to direct calls instead I don't see a problem with that, but please indicate what it might be if you do. --CBD 21:37, 7 January 2007 (UTC)[reply]
I suspect SEWilco wants to keep the current system without any change. If that's the case, then it would at least be fair to say so. We can then spare us the time argumenting here. The current system can be improved as has been laid out on this talk page. Not improving here is a lost chance in anticipating dissent from other wikipedians. People have already complained about the complexity of the current system. Some of them are also against having flags on the articles. Keeping the current system unchanged is ammunition for them. Best regards, --Ligulem 22:12, 7 January 2007 (UTC)[reply]
Nope, I want this to change. I defined these Flag Templates as being temporary until better tools become available. Is this a better tool, when you're still figuring out what is needed? (SEWilco 22:50, 7 January 2007 (UTC))[reply]
I'm figuring out what is needed? --Ligulem 23:38, 7 January 2007 (UTC)[reply]
I'm withdrawing this in favor of User:Ligulem/work/flag templates rework. See below. --Ligulem 17:57, 10 January 2007 (UTC)[reply]

As I read this discussion, I saw that you where afraid of the include size, thus I checked on the template I made before, and specially it's talk page where the template is used seven times, the result in the source code is:

<!-- 
Pre-expand include size: 62319 bytes
Post-expand include size: 2095 bytes
Template argument size: 424 bytes
Maximum: 2048000 bytes
-->

AzaToth 00:01, 8 January 2007 (UTC)[reply]

Another variant

Hi chaps. I've started hacking on a replacement using the same frontend templates as the current system but using CBD's shared data template idea. See User:Ligulem/work/flag templates rework. Not yet complete (ISO is missing), but isn't this a damn sexy data page? :-) --Ligulem 16:40, 8 January 2007 (UTC)[reply]

Whoa. When did they allow recursive parameter substitution so country_data would work? I tried that, and using a variable to invoke a template was specifically forbidden. Where is the limit on recursiveness defined, so we can ensure we won't encounter it? Storing all the country info in one place has always been desirable. And Template:Country data FRA redirects to Template:Country data France so there is only one copy of country data. (SEWilco 19:17, 8 January 2007 (UTC))[reply]
You should give a summary of the features (and function for those who are not template programmers). Looks to me like the main feature is that there is a single template with the data for each country (such as country_data_France) which is wrapped within user functions (such as country2) which call country_data_* with parameters which trigger display templates (such as country_flag2). The major features seem to be storage of all country data in one place (which can have country renaming aliases redirected to it), and consistent appearance of the flag icons. Looks like other info, such as the capitol of a country, could also be stored if there is such info which needs this kind of editor access. (SEWilco 19:33, 8 January 2007 (UTC))[reply]
Thanks for looking into this. "...for those who are not template programmers" – Man, I always had a hard time to follow what you did on templates. So please don't tell me you are not a template programmer :-). BTW I'm not sure I broke some unwritten rules with what I did (recursive parameter substitution? I didn't notice I used that...), but I don't have a bad feeling. However, some careful examination by the template gurus here might be a good idea. I will try to add the remaining missing features (country|flagISO, country|flagIOC - haven't looked into this yet), so this might then be plugged into current usage on articles by switching calls over from the xxx to xxx2 templates. The new system can be kept in parallel to the existing one, so we could prepare all data templates that are needed for a certain article and switch that article over and then extend this to more articles. BTW feel free to edit in my userspace as you see fit (page moving included). --Ligulem 21:07, 8 January 2007 (UTC)[reply]
You need to explain it to those who are reading this and trying to figure out whether they like the new method, without their having to understand every detail. I think I figured it out, which is why I tried to summarize it. So there are basically three template incantations for each call? The invocation, the country_data, and the formatter? The thing I like best is how country_data has all the info, reducing scattering of data (and only that one template has to be retrieved to get all that info). (SEWilco 03:09, 9 January 2007 (UTC))[reply]
Ah. Ok. Well, for the templates that editors on articles use, there is no change at all in usage besides adding a "2" to the current name of the template calls (country → country2, flagicon → flagicon2). So the usage documentation of the current systems applies to the new one as well. What's changed is the data template(s). But you're right. Documenting is always a good thing. Thing is, I haven't completely understood all uses of the existing system, I've just refactored it... :-). --Ligulem 09:42, 9 January 2007 (UTC)[reply]
...still thinking about the recursion thing. I don't think there is, besides for template page display on Template:Country data France, carefully packaged inside <noinclude>'s
{{ {{{1<noinclude>|country showdata</noinclude>}}} ...
                  ^^^^^^^^^^^^^^^^^
And if someone forgets the <noinclude>'s, the parser won't get mad (I trust Tim :-). --Ligulem 21:18, 8 January 2007 (UTC)[reply]
Recursion isn't quite the right word. Template invocation through that variable substitution which you used is something that I'm pretty sure I tried. Well, it works now. If it breaks it will be noticed. (SEWilco 03:09, 9 January 2007 (UTC))[reply]
I've implemented flagISO: {{country2|flagISO|FRA}} = Template:Country2. For this, I had to add "ISO alias = France" and "flag ISO alias = Flag of France.svg" to Country data France, which seems a bit redundant (also ditched the "suffix" param for template:Country showdata and introduced "countryname"). Hmmm, is this country2|flagISO needed/used? Anyway, added it for compatibility with the current system. It might be a good occasion now to review this. --Ligulem 00:25, 9 January 2007 (UTC)[reply]
Keep in mind that a three letter abbreviation might mean something different, such as in ISO and IOC. Choose the template naming to prevent conflicts, probably with "ISO" or "IOC" inside a template name pattern. (SEWilco 03:17, 9 January 2007 (UTC))[reply]
Ok. I just replicated that part ({{country|flagISO|...}}) of the current flag templates. It's in the new system now. Looking at Template:Country data France
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias           = France
| shortname alias = France
| label alias     = FRA
| flag alias      = Flag of France.svg
| ISO alias       = France
| flag ISO alias  = Flag of France.svg
| countryname = {{{countryname|France<!-- MUST MATCH SUFFIX OF PAGENAME!! -->}}}
| size        = {{{size|}}}
| name        = {{{name|}}}
}}
for example "flag ISO alias" and "flag alias" have the same value in this specific data set. I'm asking myself if the call {{country2|flagISO|...}} (formatter template) couldn't co-use "flag alias". Also the description at Wikipedia:WikiProject_Flag_Template#Implementation says:
"country_ISO_alias_ has name of Wikipedia article, referenced only by ISO 3166-1/USA FIPS 104-1 country codes."
and
"country_alias_ has the name of the Wikipedia article for the country."
Also, are there different flags for the country|flagISO needed/used? I don't mind that much, I was just asking this myself while doing the flagISO clause of template:country2.... --Ligulem 09:42, 9 January 2007 (UTC)[reply]
I think you need country_ISO_data_FRA because "FRA" may mean something different in ISO, IOC, and whatever other country codes for which support is needed. Otherwise you need "ISO" versions of all the variables, and expect data for several countries within a single country_data_* template. Notice that if "FRA" has the same meaning in ISO and IOC, country_ISO_data_FRA and country_IOC_data_FRA both could redirect to country_data_France. And if the ISO and IOC country identification is done through the _data_ addressing, are "ISO" variables needed? (SEWilco 02:23, 10 January 2007 (UTC))[reply]
Did {{country2|flagIOC|..}}, too (formatter, data). What's left? --Ligulem 12:30, 9 January 2007 (UTC)[reply]
I dropped the support for IOC per reasoning below at #Olympic flag usage (flagIOC etc.) --Ligulem 11:02, 10 January 2007 (UTC)[reply]
See a nice way to handle variants, such as historical flags (USA-48 with 48 stars)? There are some obvious ways to handle U.S. states. (SEWilco 19:45, 10 January 2007 (UTC))[reply]
I will have a look. --Ligulem 10:21, 11 January 2007 (UTC)[reply]
On another note, you might have seen this, but it wasn't evident in the examples shown at {{Country data France}}, but most of the instances I have come across of flag usage do not use the {{country|action|..}} forms, but usually call {{flagicon}} or {{flagcountry}} directly. I see that you have a test template at {{Flagicon2}}, but the Flagcountry equivalent is missing. Hope this helps, Andrwsc 19:56, 10 January 2007 (UTC)[reply]
I think country_data_* will not be called directly, so there will indeed be a flagcountry for normal use. (SEWilco 07:16, 11 January 2007 (UTC)_[reply]
I've created Template:Flagcountry2(edit talk links history) (See also [8]) --Ligulem 10:21, 11 January 2007 (UTC)[reply]

Olympic flag usage (flagIOC etc.)

SEWilco dropped a note onto Template talk:FlagIOC that this discussion was taking place, and I'm glad he did!! I need to update you all on what I have done over the past few months. Basically, I have already decoupled {{FlagIOC}} from the {{country}} mechanism and "unrolled" the template. I still call the various country_IOC_alias_xxx and country_flag_IOC_alias_xxx templates directly, but not through another level of template transclusion. The biggest change is that flagIOC now takes an additional parameter (the specific Olympic Games year) to selectively choose the correct flag for the given Games, and to render the correct wikilink.

Some examples:

To achieve this, I changed the way each of the country_flag_IOC_alias_xxx templates work for nations that have had different historical flags. For example, {{country_flag_IOC_alias_GER}} now looks like:

{{ #switch: {{{1}}}
| 1896 Summer
| 1900 Summer
| 1904 Summer
| 1906 Summer
| 1908 Summer
| 1912 Summer = Flag of the German Empire.svg
| 1936 Winter
| 1936 Summer = Flag of Germany 1933.svg
| #default = Flag of Germany.svg
}}

Off the top of my head, I'd guess that perhaps a third of the nations for which we have IOC templates (~70-80 out of ~230) now use a conditional to select the flag.

The other thing I did was add some additional templates to help editors working on Olympic-related pages. A couple of common styles were being used on those pages, such as putting a flag icon before an athlete's name and putting a wikilink to the nation after his/her name. The templates I added are intended to greatly simplify that. Specifically:

I guess the point of my message here is that a LOT of work has gone into cleaning up the Olympic-specific flag usage, and I am happy with the current state of things. There are about ~230 flag templates and another ~230 nation alias templates that are keyed to the IOC country code, and I think it is somewhat stable now. I don't see any compelling reason to try to re-work the flagIOC mechanism any further. If it is deemed necessary to remove all the IOC_alias_xxx templates in favor of something else, it is imperative that backward compatibility be maintained for the thousands of instances in which the "new" flagIOC templates are used.

Andrwsc 06:42, 10 January 2007 (UTC)[reply]

Thanks a lot for this report. If I understand this correctly, {{country|flagIOC|..}} is no longer called from any article (If we should happen to find such a call, it can be changed to {{flagIOC|...}}). In light of this, I'll drop support for {{country2|flagIOC|..}} in User:Ligulem/work/flag templates rework. The introduction of a year parameter and a switch in a data template like this one makes it incompatible with my proposal (I was not aware of this complication). So the IOC flag templates and the data templates they use in the array(s) must stay as they are (In fact, they are no longer array elements, due to the year parameter). I just hope that the flagIOC templates don't use and won't start using non-IOC related data templates, for example, the flagIOC-templates ideally shouldn't use the Country flag alias data templates. --Ligulem 10:04, 10 January 2007 (UTC)[reply]
I just noticed that Template:Country flagIOC is orphanned. So this fits very well with what Andrwsc wrote (not that I would expect anything else :-). So, I'm going to add a bold deprecation notice on Template:Country flagIOC. --Ligulem 10:13, 10 January 2007 (UTC)[reply]
Yup, you are correct, {{country|flagIOC|..}} has not been used for a long time. If you look at that template, the wikilink to "... at the 2004 Summer Olympics" was hardcoded into it. That's what got me started down the path to the evolution of {{flagIOC}}. I wanted something scalable to all 45 past Games and future ones, and parameterizing the link seemed obvious. It was later that I figured out how the same parameter could be used to select the correct historical flag.
As far as your country data templates go, I don't see anything there that we don't already have for the Olympic templates. As SEWilco noted, the IOC country code is not always the same as the ISO code (e.g. ALG vs. DZA for Algeria). More significantly, the IOC codes include several non-country entities (for example, we use {{flagIOC|IOP|1992 Summer}} to render  Independent Olympic Participants, and {{flagIOC|EUA|1964 Summer}} to render  United Team of Germany, etc.) and I don't think you want to try to force a merge of that into your country data system. I am content if the Olympic stuff remains de-coupled from that. I just don't want to see templates like {{country_flag_IOC_alias_USA}} get deleted in some future cleanup effort!! I would be happy to rename them if you want to get rid of the "country_" prefix, for example, but let me know so that we can keep all the Olympic stuff unbroken. Andrwsc 17:30, 10 January 2007 (UTC)[reply]
Nothing in use will be deleted. That would be vandalism and would quickly cost me my admin license! As you can see on this talk page, we are thinking about some improvements of the current system, like reducing the number of templates. Maintaining a large number of templates has a cost (vandalism, etc.). As I already noted, I've dropped the IOC templates from my change proposal at User:Ligulem/work/flag templates rework [9], so you are not affected by my proposal. --Ligulem 17:52, 10 January 2007 (UTC)[reply]

Handling variants, such as historical flags

Existing calls:

Using User:Ligulem/work/flag templates rework:

See

Modifications done for this:

I admit this is getting very hairy. Thoughts? --Ligulem 13:13, 11 January 2007 (UTC)[reply]

{{country2|flagcountry|BRA|1889}} = Template:Country2 — --Ligulem 13:34, 11 January 2007 (UTC)[reply]
Maybe this is simply not worth the potential problems with regards to increased complexity. Compare also with {{flagcountry2|Brazil-imperial}} = Template:Flagcountry2, which simply uses Template:Country data Brazil-imperial(edit talk links history). --Ligulem 14:14, 11 January 2007 (UTC)[reply]
My 2 bits - I think the right approach is to work all the historical flags into the same country data structure, but use different structures only for historical nations (e.g. don't put East Germany data into the Germany country data). This seems most logical to me, and also less likely to result in a proliferation of country data variants. Of course, that means more work up front to design a clean solution, but I have confidence in you.  ;) Andrwsc 18:01, 11 January 2007 (UTC)[reply]
Ligulem did just what I thought of when I read Andrwsc's comment. Simply put more flag_alias entries in the country_data_* template. By appending variant after a hyphen, several flag_alias entries can be identified, such as flag alias-1889 pointing to a different flag image. Even better, {{Country flagcountry2}}, which displays the image, has access to all the country_data info and is able to select which flag to show (and has flexibility in changing the display format). Looks nice. (SEWilco 02:25, 12 January 2007 (UTC))[reply]
The example of "Brazil-imperial" points out that in addition to a separate flag there may be a need for a separate article and a different country label. These would only be needed in templates which show a country label (an icon alone can only be linked to the image). (SEWilco 02:32, 12 January 2007 (UTC))[reply]

Usage example: European Union

As a first example for real usage, I've copied European Union to User:Ligulem/work/European Union and converted the calls there [10] (I also created the needed data templates for that article with the help of this). Compare the list of used templates in European Union with the list in User:Ligulem/work/European Union. --Ligulem 18:34, 12 January 2007 (UTC)[reply]

Template:Country flag alias Caribbean

See Template:Country flag alias Caribbean. Is this the correct flag image? --Ligulem 22:48, 4 January 2007 (UTC)[reply]

There is an ISO "CRB" abbreviation, but what entity does it refer to and what is its flag? There are only a few linked items in Special:Whatlinkshere/Template:Country_flag_alias_Caribbean (SEWilco 04:58, 5 January 2007 (UTC))[reply]

Discussion at MoS on flag icons

Please contribute to the discussion on flag icons at Wikipedia talk:Manual of Style#Flag icons - manual of style entry?. (SEWilco 14:43, 15 January 2007 (UTC))[reply]

Help! Nazi Germany

I'm working on the Fieseler Fi 156 page, and need something along the lines of Template:GER except with the German WW2 (Nazi) flag to be historically accurate. Is there a template for that? Also, is there a place where I can find a list of all of the flag icons that can be called using the [[Template:(countrycode)]] format? This list helped loads but only shows current nations, and the category for flag templates is woefully incomplete (Template:PNG was not included, for instance). Thanks! - Aerobird Target locked - Fox One! 16:57, 16 January 2007 (UTC)[reply]

Try {{flag|Nazi Germany}} (SEWilco 03:10, 17 January 2007 (UTC))[reply]
Yes! Thank you! :-) - Aerobird Target locked - Fox One! 03:41, 17 January 2007 (UTC)[reply]

Oh noez - substed flag alias templates

I looked at the what links here of Template:Country flag alias United States (to see where that is still used now) and opened Biathlon. Then I found that Country flag alias XXX are used directly there: Introduction of the flags, substing (!). Is/was this general accepted practice? Would we have to face some opposition if we would try to mass-"unsubst" such things with {{flagicon}} et al? Puzzled, --Ligulem 00:18, 27 January 2007 (UTC)[reply]

I don't believe it is a widespread practice, but it does happen, as you've seen. I think I replaced this once or twice on some other pages a couple of months ago without complaint. (In that case, it was inappropriate use of the country_flag_IOC_alias variants which I replaced with flagicon, on a page about world war II films, if I remember...) These should be easy to spot after you've upgraded the main templates, as they would be the few remaining direct links to the old country_flag_alias_xxx templates. Andrwsc 00:32, 27 January 2007 (UTC)[reply]
I just noticed that many of those remaining links to are due to {{flagof}}, which ought to be replaced. I will do something in the meantime. Andrwsc 00:39, 27 January 2007 (UTC)[reply]
Additionally, there are several places where Template:Country_flagicon is called directly. That should be updated as well. Andrwsc 00:53, 27 January 2007 (UTC)[reply]
Oh yes. Subst "zombies" (I mean the result of the subst, not the Wikipedian – just to be clear ;-) like this one. I already did some mass removals of flags in signatures (duh! [11]). I'm going to zap these as well per WP:SIG. --Ligulem 09:11, 27 January 2007 (UTC)[reply]
I had dropped a note on that user's talk page yesterday about the strange sig (uses a conditional that always tests true?) and he has replied that he no longer uses that flag, but in the meantime, there are dozens of talk pages that use the old sig...
I also found some other templates yesterday that used to call country_alias_xxx templates directly. I have fixed Template:flagof and Template:Bilateral to use the standard calls, so that should cut down a large number of "zombies" too. Andrwsc 16:50, 27 January 2007 (UTC)[reply]
Just for the records: There are now zero pages in main namespace transcluding Template:Country flag alias United States [12]. --Ligulem 19:10, 27 January 2007 (UTC)[reply]

Categorisation error

Thought y'all might want to know that a whole load of extranious pages have been categorised under Category:Flag templates. True, there were a number of country templates that needed to be added, but somebody went overboard... - Aerobird Target locked - Fox One! 14:42, 29 January 2007 (UTC)[reply]

Thanks for reporting. I did a Special:Recentchangeslinked/Category:Flag_templates and looked for changed templates. Quickly spotted template:SYR: [13]. User:Akradecki simply forgot to wrap the cat into noincludes :-) (this sort of error happens easily, I have done this error myself too occasionally :-). So, just an error, not vandalism (I toned down the section title from "Categorisation vandalism" to "Categorisation error"). And fixed it. --Ligulem 15:34, 29 January 2007 (UTC)[reply]
Thanks for the fix. :-) - Aerobird Target locked - Fox One! 15:55, 29 January 2007 (UTC)[reply]
The job queue is currently floating around 20'000 entries, so it will take some time until the articles are updated. So don't be surprised if the cat is still overpopulated at the moment :-). On Mondays it might take half an hour or so until the servers have caught up... --Ligulem 15:58, 29 January 2007 (UTC)[reply]

Some thoughts...

I have been helping out the transition effort to the new "country data" based template calls, and have some observations based on what I have seen.

First, both the original implementation and the new one were based on a single template ({{country}}) that had a variety of "action" or "formatter" arguments, which in turn caused the invocation of a "second layer" of template calls. My observation is that virtually nobody uses the {{country|action|...}} style of template calls. If they are still needed for internal operation, that's fine, but we should document it as internal use only. We should not promote the use of {{country}} as something editors should use in wiki markup in normal usage.

Furthermore, some of these "actions" are also virtually unused, namely flagISO and name. I see one usage of {{country|name|...}} in Template:Bilateral, but that's about it.

Next, I see that the vast majority of articles require one of two things:

  • a flag icon, followed by a country name or code that is wikilinked to the article for that country
  • just the flag icon by itself

Obviously, {{flagicon}} is the preferred way to render the latter. Right now, there is a wide variety of names used as the country parameter to that template (e.g. sometimes the name of the nation is used, and sometimes a country code is used), but the end result is the same. Therefore, {{flagicon|USA}} and {{flagicon|United States}} render exactly the same thing, and I think that is a good thing.

For the former, I see three techniques used:

  1. {{flagcountry}}
  2. {{flag}}
  3. shortcut template names (such as {{USA}}) that typically render the same thing as a call to {{flagcountry}} (see full? list at Wikipedia:Inline templates linking countries)

The problem I see is that {{flagcountry}} and {{flag}} do more or less the same thing, but with a different name for the wikilinked country string. One thing they do is "translate" the country argument so that you get a full name out of {{flagcountry}} and a ISO code out of {{flag}}. For example:

In my mind, this is not intuitive. I think it is a good thing that the input argument to these templates can be either a name or a code, but I don't think it is useful for the output string to be modified.

What is especially vexing is that we accept non-ISO country codes as input arguments, but always use the ISO code for the output of {{flag}}. This results in some strange wikicode. If I want to render Germany GER (e.g. for sports articles where "GER" is the country code for Germany), there is no easy way to do it. {{flag|GER}} gives me  GER. One solution is to write {{flag|GER|name=GER}}, but that is obtuse to say the least!

It seems to me that we don't really need both {{flagcountry}} and {{flag}}. We need to make it easy for editors to put a flag in front of their desired string. What seems most intuitive to me would be for this behaviour:

  • {{flag|Germany}} renders Germany Germany
  • {{flag|DEU}} renders Germany DEU
  • {{flag|GER}} renders Germany GER

I think this is technically easy to do. The modified flag template would set the name= argument to the first parameter, or something like that. I haven't mocked it up yet.

What would be more time consuming is going through the instances where flag or flagcountry is used and see if they are depending upon the "translation" capability or not.

One thing I would not touch is the set of "shortcut templates" (like {{USA}}), as editors clearly know what to expect from that.

Comments? Andrwsc 00:22, 1 February 2007 (UTC)[reply]

Not yet a complete response, but I was also puzzled why people would use {{country|flagcountry|...}} instead of the simpler {{flagcountry}} (did some of these: [14]). In fact, template:country makes tracking the different sorts of calls more difficult, as it is easy to do a "what links here" of {{flagcountry}} whereas {{country|flagcountry|...}} cannot be enumerated without visiting every call (or scanning a database dump). Note that template:flagcountry no longer calls template:country ([15]). As a side note, I would like to point out that the change I did with the data templates is just an internal refactoring, so the "new" system provides the same functionality as SEWilco's original implementation. Just with less templates. I have now unprotected all of the original array templates, which are nearly completely orphanned. (Going to bed now). --Ligulem 00:55, 1 February 2007 (UTC)[reply]
I guess a quick summary of my comments is that I realize that your work mostly provides a more efficient implementation of SEWilco's original work (using wiki features not available to him at the time), but perhaps we should re-examine the full scope of that implementation, now that we have a year or two of usage to look at. Exactly what problems do we need solutions for? Can we remove unused features and fix ones that are "broken" in the eyes of some editors?
Have a good sleep.  ;) Andrwsc 01:00, 1 February 2007 (UTC)[reply]
FYI, I researched current use counts (Warning: table below is transcluded from Wikipedia:WikiProject Flag Template/Table 2007-02-01):
Template # pages
calling
Used when calling..
Template:flagicon 41,659 Updated 13:13, 2 February 2007 (UTC)
Template:flagcountry 13,523 Updated 13:13, 2 February 2007 (UTC)
Template:Country 106 Updated 14:05, 2 February 2007 (UTC)
Template:flag 1,037 Updated 13:13, 2 February 2007 (UTC)
Template:ISO 7 Updated 13:13, 2 February 2007 (UTC)
Template:Country flagicon2 41,635 {{country|flagicon|..}}, {{flagicon|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country flagcountry2 13,561 {{country|flagcountry|..}}, {{flagcountry|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country flag2 1,046 {{country|flag|..}}, {{flag|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country name2 66 {{country|name|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country flagISO2 7 {{country|flagISO|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country get alias2 6 {{country|get alias|..}} Updated 13:13, 2 February 2007 (UTC)
Template:Country get flag alias2 6 {{country|get flag alias|..}} Updated 13:13, 2 February 2007 (UTC)
Note that {{Country flagISO2}} is almost only called on the template:Country data XXX pages (ditto for {{Country name2}}). Category:Country data templates has 777 entries. --Ligulem 14:33, 1 February 2007 (UTC)[reply]
This is interesting, and encouraging! I think that "flag" is far too valuable a template name to be used for just it's current purpose (flagicon + wikilinked ISO code), but since it is used in only 1000-2000 pages, it might be possible to redefine it in a backward compatible way as I've described above. For example, all instances of {{flag|Country Name}} would be replaced by {{flag|ISO}} first. This would have no effect on the rendered pages. Then we can extend the functionality of {{flag|...}} without causing any changes to those 1000-2000 pages. Finally, the new functionality can be published and used (instead of flagcountry, for example) as editors see fit. Andrwsc 20:15, 1 February 2007 (UTC)[reply]
Another note - my proposed functionality is absolutely trivial to implement. Take a look at User:Andrwsc/Flagtest (and test calls on the talk page), which is basically a direct copy of {{flagcountry}} but with one very small difference - the name parameter defaults to the first template argument instead of blank. Andrwsc 22:17, 1 February 2007 (UTC)[reply]
Neutral observation: If we would replace the code of {{flag}} with [16], this would mean that the "label alias" values of the country data templates would no longer be used for {{flag}} calls (see [17]), because {{{name}}} is then either set by the caller or defaulted to what is provided as parameter 1 of {{flag}}. --Ligulem 23:56, 1 February 2007 (UTC)[reply]

ISO alias, flag ISO alias

Because it's untranscluded in articles I've redirected Template:Country flagISO2 (has a total of 5 transclusions) to Template:Country flagcountry2 and removed the ISO options from Template:Country/doc ([18]). Would anybody yell at me if I would mass remove the now unused "ISO alias" and "flag ISO alias" parameters from the country data templates? --Ligulem 14:26, 2 February 2007 (UTC)[reply]
I wouldn't yell! I just don't think we need a template that translates a long name to a country code. I think we only need for the flagxxx templates to accept country codes as input arguments, and that is accomplished by creating redirects such as from {{Country_data_DEU}} to {{Country_data_Germany}}, to name one example. Obviously, the flagISO methods originally conceived have not been used by editors since then, so I think it is safe to remove them during this re-implementation effort. Andrwsc 17:41, 2 February 2007 (UTC)[reply]

countryname instead of label alias

How about just doing this to {{Country flag2}}? {{{countryname}}} is parameter {{{1}}} feeded through from {{flag}}. All country data templates feed {{{countryname}}} into {{Country flag2}} when called from {{flag}} (this is true for all entry points). --Ligulem 20:04, 2 February 2007 (UTC)[reply]

I'm not sure that would work the same way. If we are using redirects for the country code inputs (e.g. {{Country data GER}} → {{Country data Germany}}), then this parameter would be "Germany" in all cases instead of "GER" or "DEU" if desired. Andrwsc 21:57, 2 February 2007 (UTC)[reply]
I think you are wrong. In the call {{flag|Germany}}, {{{countryname}}} has value "Germany". In the call {{flag|GER}}, {{{countryname}}} has value "GER". I will elaborate that below in a moment. --Ligulem 23:07, 2 February 2007 (UTC)[reply]

(1) {{flag|GER}}
(2) expands to: {{country data GER | country flag2 | countryname = GER }}
(3) expands to (redirect): {{country data Germany | country flag2 | countryname = GER }}
(4) expands to: {{country flag2 | alias = Germany | shortname alias = Germany | label alias = DEU | flag alias = Flag of Germany.svg | countryname = GER}} (I already left away the ISO params here)
(5) would expand to: [[Image: Flag of Germany.svg|22x20px|Flag of Germany]] [[Germany|GER]] (if we presume we set {{Country flag2}} to use this template code)
--Ligulem 23:26, 2 February 2007 (UTC)[reply]

Ah, I see now, thanks! The trick is that "countryname" is set before the redirect, not after (as I had thought). Andrwsc 00:11, 3 February 2007 (UTC)[reply]
And as for the proposed change, I think we need two things: 1) more discussion, especially SEWilco's input, since this is a fairly major redefinition of a high-use template, and 2) replacement of all existing calls to {{flag}} to change the input argument to the code string if it already isn't, thus ensuring backward compatibility. For that, I'll need your help to edit the protected template. The "temporary category" trick is what I have in mind to get a list of articles use flag with a full-name argument:
{{ #ifeq: {{{label alias}}} | {{{countryname}}} | <!-- ok --> | [[Category:Articles that use Flag without country codes]] }}
Andrwsc 00:22, 3 February 2007 (UTC)[reply]
I'm a bit puzzled. Wouldn't that have been needed with your proposal (User:Andrwsc/Flagtest) as well, or is there some additional complexity with my counter-proposal? Puzzled. On another note, I've seen enough flag templates for today (We must be really mad doing all this ;-). See ya. --Ligulem 00:48, 3 February 2007 (UTC)[reply]
...and I don't know where to put your template code snippet. (Now I'm really gone for today). --Ligulem 00:51, 3 February 2007 (UTC)[reply]
Ok. Got it [19]. And created Category:Articles that use Flag without country codes. --Ligulem 08:50, 3 February 2007 (UTC)[reply]
I saved the content of the cat at User:Ligulem/work/Articles that use Flag without country codes. --Ligulem 09:11, 3 February 2007 (UTC)[reply]
...and reverted the temporary change on the template [20]. --Ligulem 09:13, 3 February 2007 (UTC)[reply]
...and deleted the cat after it was orphanned. --Ligulem 09:44, 3 February 2007 (UTC)[reply]
I removed all country data templates from the list [21]. --Ligulem 09:53, 3 February 2007 (UTC)[reply]
Sorry, I was away for a few hours, but it looks like you figured out what I was trying to say! I had noticed that of the ~1100 pages on the "What links here" list of {{flag}}, a large number were because of the link from country_showdata, but also that a large number were pages that had a small handful of {{flag|USA}}, {{flag|EU}}, etc. For example, pages on books or video games use these templates for release dates, etc. What I really wanted to know was how many pages actually relied upon the "translation" ability of that template, and had a large number of {{flag|Germany}}, {{flag|France}}, etc. instead of being written with the country codes as input arguments. I am somewhat astonished — in a good way! — that there are only 94 pages on your list, and a small subset of that in the main article space!! I think that reinforces my proposal, that this change would not negatively impact very many articles at all. Thanks for your help - I think I'll work on the articles on that list to potentially prepare for the transition. Andrwsc 19:51, 3 February 2007 (UTC)[reply]
I made Template:FlagA (edit talk links history) (for "flag Andrwsc" :-):
  • {{flagA|Germany}} = Flag of Germany GermanyFor testing only!!!
  • {{flagA|DEU}} = Flag of Germany DEUFor testing only!!!
  • {{flagA|GER}} = Flag of Germany GERFor testing only!!!
  • {{flagA|GER|name=voodoo}} = Flag of Germany voodooFor testing only!!!
  • {{flagA|GER|size=30px}} = Flag of Germany GERFor testing only!!!
as a mock-up. It uses Template:Country flagA2 (edit talk links history). --Ligulem 23:54, 3 February 2007 (UTC)[reply]

Andrwsc's most intuitive behaviour

Andrwsc wrote: What seems most intuitive to me would be for this behaviour:

  • {{flag|Germany}} renders Flag of Germany Germany
  • {{flag|DEU}} renders Flag of Germany DEU
  • {{flag|GER}} renders Flag of Germany GER
What should be done with current calls
? --Ligulem 23:14, 3 February 2007 (UTC)[reply]
?? --Ligulem 23:58, 3 February 2007 (UTC)[reply]
Heh, I like the subsection heading.  ;) Here's my opinion on each of those first six examples:
  • {{Country data Bulgaria 1946}} should be deleted and the flag put as a "1946" variant inside the main {{Country data Bulgaria}} template. Then, to render that variant, you would call {{flagcountry|Bulgaria|1946}}
  • works fine as is
  • I would make the main data structure for each of the 50 states aligned with the main article name, so it would be {{Country data Florida}} in this case. There would be at least two redirects, one from {{Country data FL}} and another from the existing {{Country data USA-FL}} for backward compatibility. Then, you could just use {{flag|FL}} to get the state code or {{flag|Florida}} to get the full name. flagcountry with any of those three parameters would render "Florida".
  • works fine as is
  • I would do two things. Since Weimar Republic is a main article, we ought to use {{Country data Weimar Republic}}. There should be a variant in the {{Country data Germany}} template if the editor wants to make the wikilink to Germany. (In fact, I did that yesterday in my first attempts with the variant code.) That gives the editor a few options: {{flag|Weimar Republic}}, {{flag|Weimar Republic|name=Germany}}, {{flag|Germany|Weimar}}, etc. It all depends on what you want the wikilink to point to and what you want the name to say.
  • works fine as is
I'm not exactly sure what answers you were unsure of, but hopefully my opinions here are logical. I think you can see what I am driving at. Andrwsc 07:33, 4 February 2007 (UTC)[reply]
What should be done with:
Isn't that a name clash on {{country data Georgia}} with your new system? Please state the calls you would like to use for these two in your new system. --Ligulem 10:01, 4 February 2007 (UTC)[reply]
Hmmm. Andrwsc wrote: "There should be a variant in the {{Country data Germany}} template if the editor wants to make the wikilink to Germany". I do not understand that completely. We currently have {{{variant}}} used for the "flag alias" parameter of the data templates but not for "alias" ([22], [23]). Do you mean that the variant system should be extended onto the "alias" parameter? This sounds like getting very nasty. If we need variants for every field in the data templates, we start mimicking data template forks inside data templates. Plus I fear your "most intuitive" system produces name clashes on the data templates. It looks neat on the "GER", "DEU", "Germany" example, but I fear it causes problems when we try to implement that completely. Names of the data templates (or redirects to them) are then predetermined by what the link text should read. This smells a bit like a non-orthogonality to me. --Ligulem 10:29, 4 February 2007 (UTC)[reply]
No, not at all!! Let me try to explain my ideas again.
Within the country_data templates, alias is fixed to a single value, the name of the main Wikipedia article. It cannot be changed. If you want a new link, you need a new country_data structure. Conversely, that also means that we shouldn't have country_data structures for non-existant articles. They should be redirects to the "real" one. Using Florida as an example of this concept, Country_data_Florida is correct as is. County_data_FL and Country_data_USA-FL only exist so that "FL" and "USA-FL" can be used as alternatives to "Florida" in the calls to the flag, flagcountry, and flagicon templates.
Next, 'shortname alias' is also fixed to a single value within the template, but can be overridden in one of two ways. For flagcountry, the name= argument would be used. For the proposed flag (flagA now ;), the first argument used with the template call would be used.
Next, the 'flag alias' is the one parameter within Country_data structures that will have multiple variants. I think this is WAY more logical to handle situations like the 1946-1967 flag of Bulgaria. There is no reason to create a new Country_data structure, espectially since the alias and shortname_alias fields would be the same. For editors wanting to use that flag, it is an extremely minor change from a space to a pipe character! (e.g {{flagcountry|Bulgaria|1946}} instead of {{flagcountry|Bulgaria 1946}}
As for any confusion I created with my response on Weimar Republic, let me elaborate. Since there are articles for both Germany and Weimar Republic, I think that means we ought to have Country_data templates for both. In different instances, editors may want to link to either one. {{flagcountry|Germany|Weimar}} renders Flag of Germany Germany and {{flagcountry|Weimar Republic}} renders Flag of Weimar Republic Weimar Republic Of course, you could also use {{flagcountry|Weimar Republic|name=Germany}} to render Flag of Weimar Republic Germany
Finally, with respect to the name conflict on Georgia, we maintain the existing status quo. I think Template:Country data Georgia already does the right thing. The main template for the US state would need to be Template:Country data Georgia (U.S. state), with redirects from the two shorthand labels, Country_data_GA and Country_data_USA-GA. This means that you can do these:
To be honest, I don't think I've seen any instance of flagcountry with any of the US states - they tend to use the current flag to get the two letter code instead - so I think these ideas don't impact any current pages.
I hope this makes sense! I don't think I'm proposing anything radical here, just a cleanup and merge from many of the redudant Country_data structures into the main ones for each country, using flag variants and redirects as appropriate. Andrwsc 17:14, 4 February 2007 (UTC)[reply]
I feel quite confident that you know what needs to be done :-). I probably just do have some problems following you. I agree with doing "flag alias XXX" for cases like the 1946-1967 flag of Bulgaria and I agree that it makes sense to name the Country data templates after the main article (So having template:Country data Florida, template:Country data Georgia (U.S. state) and template:Country data Weimar Republic). What still confuses me is your sentence "There should be a variant in the {{Country data Germany}} template if the editor wants to make the wikilink to Germany". I interpret this as doing a country data template like this:
...
flag alias = wee bee.svg
flag alias-variant1 = blurp blomp.svg
flag alias-variant2 = foo bar.svg
label alias = bla
label alias-variant1 = bla bla
label alias-variant2 = ping pong
...
which I think would be A Bad Thing™ (but I now have some doubts you really meant that). --Ligulem 19:08, 4 February 2007 (UTC)[reply]
No, I definitely don't mean that! I guess that sentence was a bit unclear. What I meant was that I think there are instances where editors will want to use the Weimar Republic flag, but still use Germany as the wikilinked country. That means we need a variant inside the Country_data_Germany structure to show that flag, but retain "Germany" as the alias and shortname alias. We're giving editors more options, in a logical, scalable way, by providing both {{flagcountry|Germany|Weimar}} and {{flagcountry|Weimar Republic}}. Andrwsc 00:02, 5 February 2007 (UTC)[reply]
Ok. I think I got it now. Everything in harmony then ;-). --Ligulem 00:10, 5 February 2007 (UTC)[reply]
All calls {{flagcountry|USA-FL}} = Flag of Florida Florida in articles would need to be changed to {{flag|Florida}} = Template:FlagA prior to exchanging the code of template:flagcountry with template:flagA (or User:Andrwsc/Flagtest), because {{flagA|USA-FL}} = Template:FlagA would break current expectations, right? (I believe there is no article using template:country data USA-FL on User:Ligulem/work/Articles that use Flag without country codes) --Ligulem 11:05, 4 February 2007 (UTC)[reply]
Yes, definitely. The templates for the 50 US states, and 10 Canadian provinces (e.g. CAN-BC) are the only ones that don't have existing Country_data templates under the "right" name, I think. Fortunately, there are less than 10 pages that use them with the flag template, I think. Most of the time, flagicon is used, so the label doesn't matter. Andrwsc 17:14, 4 February 2007 (UTC)[reply]
Have a look at my log ;-) --Ligulem 00:10, 5 February 2007 (UTC)[reply]

Major rewrite of the project page

I've done a major rewrite of the project page to adapt for the new template system used (the country data templates). --Ligulem 16:29, 9 February 2007 (UTC)[reply]

Some thoughts...

After spending lots of time working with the new templates, I have a few ideas for possible improvements that I'd like to discuss here:

Bordered icons

A few months ago, people starting using alternate flag images for flag icons, specifically, modifications to the "main" flag image to put a black border around it. The improvement is noticable at 22x20px (e.g. compare Japan at vs. ). This method seems to have caught on instead of using the {{border}} template for a couple of reasons (my speculation): it is simpler to add the bordered version to the flag template, thereby instantly updating all occurances, and it results in less complexity in the eventual page rendering.

One problem is that the bordered versions do not look very good when shown at a larger size. The {{border}} template produces much better results. This means that editors are forced to use the image directly instead of using any of the flag templates (e.g. compare {{flagicon|Japan|size=150px}} vs. {{border|[[Image:Flag of Japan.svg|150px]]}})
Japan vs.

What I would like to propose is that we add "icon alias" entries to the country_data templates for nations that need a "(bordered)" version for icon usage. The flag templates would select either "flag alias" or "icon alias" based on the presence of the "size" parameter or not. For example, the code for {{country flagicon2}} would now look like:

[[Image:{{
  #if: {{{variant|}}} | {{{flag alias-{{{variant}}}}}} | {{#if: {{{size|}}} | {{{flag alias}}} | {{{icon alias|{{{flag alias}}}}}} }}
}}|{{
  #if: {{{size|}}} | {{{size}}} | 22x20px
}}|Flag of {{{alias}}}]]

(This is off the top of my head and not sandboxed, but you get the idea.)

One other benefit I can see by having both bordered and non-bordered versions of the flag within the country_data structures is that it might stop or reduce edit/revert cycles over which one is "best". Editors have two methods by which to get the flag they want. Normal usage of flagicon or flagcountry would give the icon version (if available); editors can override and get the non-bordered version by specifying any size (even 22x20px).

I think using the size parameter as the "key" for selection makes most sense because it is the size of the flag that determines whether or not the "(bordered)" versions look good or not.

Hover label: "Flag of Country"

The default hover box over flag icons is to use "Flag of {{{alias}}}", which is a great idea. One minor problem is that it produces incorrect grammar for some nation names. For example, it should really read "Flag of the United States" instead of "Flag of United States". The Netherlands, United Kingdom, Bahamas, and a few other countries also share this issue.

One extremely simple and effective fix would be to add something like "alias prefix = the" to the country_data structure for those handful of nations, and then change code to render the caption to:

|Flag of {{alias prefix|}}} {{{alias}}}]]

On a related note, I'd like to add a "See also" notice to {{country showdata}} to link to the appropriate "[[Flag of {{alias prefix|}}} {{{alias}}}]]" article, as I think it would be a very useful reference for historic flag maintenance, and this would also be a good way to find all the nations that need the "the" prefix.

National team templates

I think by far the most common usage of flag icons is for sports result pages. It seemed as though they were mostly what I have been editing recently to update flag template calls. One observation is that several team sports each have their own very large set of flag templates that effectively reproduce what we have implemented here. For example, check out Category:National football team templates, which has approximately 850 templates alone! Other sports, such as ice hockey, rugby union and cricket all have similar template sets, but they are not as well-documented as the football ones.

Some problems with this system are that the calling convention for historic flags is different between sports, and different from the variant labels we have started to use. Furthermore, they are not always accurate or complete. For example, not all of the US flag variants exist, so some editors had to resort to using the image directly. Another example - Canada is shown as only having one historic flag (see {{CANfold}}) when there were actually three different red ensigns.

What I'd like to propose, and this will have to be done with approval of each sport's WikiProject, is to consolidate upon the country_data templates and replace the sport-specific templates. It was trivially easy to create a single template that I would estimate can be used for 90% of those football specific ones. I created {{national sports team}} as the main template to render the flag and link, and then {{fb}} for a football specific one.

For example:

Old New
{{ITAf}} Template:ITAf {{fb|ITA}}  Italy
{{ITAfold}} Template:ITAfold {{fb|ITA|old}}  Italy

This is an extremely scalable system. We only need per-sport templates (like {{fb}}) for football, but for ice hockey, basketball, rugby union, etc. as per Category:National sports teams to replace over a thousand specific instances. There are a few special cases where the team flag is different or the team name is different (e.g. instead of New Zealand national rugby union team, the preferred name is at All Blacks), but the beauty of the country_data system is that special cases can be handled there (for example, use an override parameter like "rugby union national team = All Blacks" inside country_data_New_Zealand). Some tweaking to {{national sports team}} is needed to pick up those names, as is handling of nations that have both men's and women's team articles, but neither is a big deal.

In any case, I'd like to get some discussion and consensus here before bringing this to the respective sports wikiprojects. Andrwsc 20:09, 20 February 2007 (UTC)[reply]