Template talk:Flag
Add topic| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||
| ||||||||||||||||||||||
| Template:Flag is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify a template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This template was considered for merging with Template:Flagcountry on 2014 December 10. The result of the discussion was do not merge. |
Template-protected edit request, June 28, 2025
[edit]This edit request to Template:Flag/core has been answered. Set the |answered= parameter to no to reactivate your request. |
This is to fix the behavior of the non-breaking spaces between the images and the text of this template. Most browsers don't render a non-breaking space next to an image as expected — see my sandbox, where changing the window width should show the behavior I'm talking about. A similar request was implemented for {{Icon link}} (Module:Icon) last year. Here's the change to be made:
| − | <span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] | + | <span class="flagicon nowrap">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg|Flag of Switzerland (Pantone).svg|Flag of Vatican City State - 2023 version.svg= }}{{#ifeq:{{{alias}}}|Nepal| }}</span>[[{{{alias}}}|{{{name}}}]] |
Let me know if you have any questions! —TechnoSquirrel69 (sigh) 06:57, 28 June 2025 (UTC)
{{done}}Primefac (talk) 10:45, 28 June 2025 (UTC) Reverted per subsequent post. Primefac (talk) 13:44, 28 June 2025 (UTC)- This edit has caused obscure Linter errors in a few pages. See my sandbox for a current set of examples, copied from another page. The help page says
One simple solution would be add a whitespace character after the span in the affected template
. Would that work here? Maybe one of the zero-width space character templates would be useful if we don't want more actual whitespace. – Jonesey95 (talk) 13:29, 28 June 2025 (UTC)- @Jonesey95: Thanks for your input! Maybe this is something I'm doing wrong on my end, but I can't reproduce this error. My sandbox still has transclusions of {{Flag/core/sandbox}}, but Special:PageInfo doesn't show me any errors for the page. Also, I've used similar markup in the {{DCWC participant}} template, and I don't see any errors for that either. Could you elaborate on how you came across this? —TechnoSquirrel69 (sigh) 14:30, 28 June 2025 (UTC)
- It doesn't seem to cause the error all the time, but the current version of User:Jonesey95/sandbox causes the error when it is put into Special:ExpandTemplates. The problem is described on the help page: the parser can't figure out where to put spaces when the spans are jammed together. I removed spaces from User:TechnoSquirrel69/sandbox, but for some reason, the error doesn't show up. I clearly don't understand the Linter criteria for flagging this error condition, but it is showing up at User:Nomoskedasticity when the above version is used. – Jonesey95 (talk) 15:10, 28 June 2025 (UTC)
- Hmm, the other theory I wanted to test was that it was caused by the indirect way that {{Flag}} transcludes {{Flag/core}}. However, I didn't encounter the error on your sandbox — which is using {{Flag/sandbox}} — on Nomoskedasticity's user page, or on my sandbox. I checked through PageInfo, ExpandTemplates, and Special:LintErrors. Also, as I mentioned in the original post, {{Icon link}} has been using this kind of markup for some time now and I'm not able to find any errors on pages that use it either.I've gone ahead a reactivated the edit request — Primefac, if you're also unable to find the issue, would you be willing to implement it again? This seems to be a relatively minor error even if it crops up, but I can keep an eye on it and troubleshoot if it happens again. —TechnoSquirrel69 (sigh) 17:30, 28 June 2025 (UTC)
- It doesn't seem to cause the error all the time, but the current version of User:Jonesey95/sandbox causes the error when it is put into Special:ExpandTemplates. The problem is described on the help page: the parser can't figure out where to put spaces when the spans are jammed together. I removed spaces from User:TechnoSquirrel69/sandbox, but for some reason, the error doesn't show up. I clearly don't understand the Linter criteria for flagging this error condition, but it is showing up at User:Nomoskedasticity when the above version is used. – Jonesey95 (talk) 15:10, 28 June 2025 (UTC)
- @Jonesey95: Thanks for your input! Maybe this is something I'm doing wrong on my end, but I can't reproduce this error. My sandbox still has transclusions of {{Flag/core/sandbox}}, but Special:PageInfo doesn't show me any errors for the page. Also, I've used similar markup in the {{DCWC participant}} template, and I don't see any errors for that either. Could you elaborate on how you came across this? —TechnoSquirrel69 (sigh) 14:30, 28 June 2025 (UTC)
- This edit has caused obscure Linter errors in a few pages. See my sandbox for a current set of examples, copied from another page. The help page says
Done Primefac (talk) 20:37, 28 June 2025 (UTC)
- Thanks! Checking Special:LintErrors/tidy-whitespace-bug this morning and it is indeed populating pages where {{Flag}} is throwing this error. I'm trying to track down where in the process the error is occurring (possibly through the country data template family) but it might take a minute since LintErrors doesn't update immediately every time I save my sandbox. Maybe we could try a
​(zero-width space) like Jonesey95 suggested? —TechnoSquirrel69 (sigh) 03:25, 29 June 2025 (UTC)- Well, Anomalocaris seems to have worked some magic to those pages, and the errors are now gone — thanks, Anomalocaris! —TechnoSquirrel69 (sigh) 05:18, 29 June 2025 (UTC)
- I saw Special:LintErrors/tidy-whitespace-bug lint errors, and experimentally, it seemed that inserting a space before the flag template made the error go away, so I went with that in 2018 Qingdao SCO summit, List of wars involving Canada, User talk:Benlisquare, and User:Nomoskedasticity/TravelTable. I hope I didn't introduce any unwanted side-effects. —Anomalocaris (talk) 05:28, 29 June 2025 (UTC)
- Quite the opposite, you removed the unwanted side-effects caused by my edit to this template! Thanks again, and I'll look out for this in the future as I'm planning to make similar changes to related templates like {{Flagg}} as well. —TechnoSquirrel69 (sigh) 05:32, 29 June 2025 (UTC)
- I saw Special:LintErrors/tidy-whitespace-bug lint errors, and experimentally, it seemed that inserting a space before the flag template made the error go away, so I went with that in 2018 Qingdao SCO summit, List of wars involving Canada, User talk:Benlisquare, and User:Nomoskedasticity/TravelTable. I hope I didn't introduce any unwanted side-effects. —Anomalocaris (talk) 05:28, 29 June 2025 (UTC)
- Well, Anomalocaris seems to have worked some magic to those pages, and the errors are now gone — thanks, Anomalocaris! —TechnoSquirrel69 (sigh) 05:18, 29 June 2025 (UTC)
- Thanks! Checking Special:LintErrors/tidy-whitespace-bug this morning and it is indeed populating pages where {{Flag}} is throwing this error. I'm trying to track down where in the process the error is occurring (possibly through the country data template family) but it might take a minute since LintErrors doesn't update immediately every time I save my sandbox. Maybe we could try a
Incorrect Auckland flag
[edit]Kia ora, this template produces a flag of Auckland that hasnt been valid since 2010. Please fix by removing as Auckland does not currently have a flag TheLoyalOrder (talk) 20:52, 26 December 2025 (UTC)
- Can I just check you're talking about Template:Country data Auckland? Primefac (talk) 21:52, 26 December 2025 (UTC)
The "name" parameter doesn't work properly for Taiwan
[edit]Umm Al Quwain
[edit]The Flag template, far as I can tell, carries an incorrect, archaic, spelling of Umm Al Quwain (Umm al-Quwain). I'd try and fix it myself but I'd end up breaking endless things, so can someone who knows what they're doing pitch in? Best Alexandermcnabb (talk) 13:48, 24 September 2026 (UTC)
- Which flag template? Template:Country data Umm Al Quwain doesn't seem to exist. Primefac (talk) 11:33, 26 September 2026 (UTC)
- You're looking for Template:Country data Umm al-Quwain. However, I don't agree that the spelling is "incorrect" or "archaic". This is an entirely normal variation in Arabic transliteration. However, it does differ from the variant used by Emirate of Umm Al Quwain so it would be helpful if
Umm Al Quwain
were treated as a valid alias. The country data already has the full article title,Emirate of Umm Al Quwain
as an alias, but it should also treat the shorter counterpart as valid too. I've gone ahead and done so as a shortname alias.{{flag|Umm Al Quwain}}now works. – Scyrme (talk/solidarity) 19:07, 26 September 2026 (UTC)
- You're looking for Template:Country data Umm al-Quwain. However, I don't agree that the spelling is "incorrect" or "archaic". This is an entirely normal variation in Arabic transliteration. However, it does differ from the variant used by Emirate of Umm Al Quwain so it would be helpful if