Jump to content

Module talk:Political party/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Primefac (talk | contribs) at 14:22, 14 January 2022 (archiving completed and/or older discussions). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Archive 1Archive 2Archive 3Archive 4

How to address contrast between colours and text

A few editors have raised issues with the meta/colors potentially not being compliant with accessibility standards, and have changed the colours to match these standard. I personally feel we would be better off changing the use of these templates to ensure compliance, than changing their use. What do people think? YttriumShrew (talk) 20:00, 4 December 2021 (UTC)

Yes, agreed – /meta/colors shouldn't be used as background colours in fields with text – they're designed for empty cells or rows. Cheers, Number 57 20:09, 4 December 2021 (UTC)
Yes, accessibility should be followed. Gonnym (talk) 20:40, 4 December 2021 (UTC)

Defaults and error handling

I've combined some similar threads about error handling into this one mega-thread; hopefully this will keep similar issues together. Primefac (talk) 21:48, 12 December 2021 (UTC)

Is it possible to implement error-tracking categories?

I don't know enough Lua to make this happen, but articles like Labor Party (Hawaii) in its current state, which are showing errors like "parameter 1 should be a party name" should probably emit maintenance categories so that we can track them down and fix their problems. I'm happy to do the tracking down, I just don't know enough to make the categories happen in Lua. – Jonesey95 (talk) 17:35, 7 December 2021 (UTC)

Yes and no. We originally had them as script errors, but due to concerns that we would be flooding the script error category we scrapped that. Then, we tried putting cats straight in, but when you try to stick in Category:X in the middle of a background: <color> command, things get a little not-happy. So the short answer is yes, we can easily do it, but no one will like it, or we could try to figure out a longer way that may take a bit to figure out. Primefac (talk) 17:43, 7 December 2021 (UTC)

Allowing empty party name may be needed

I don't know how these used to display, but it appears that empty party names are currently displaying big red error messages in 400+ articles. Somewhere, an adjustment should probably be made to allow empty party name parameters more gracefully. – Jonesey95 (talk) 06:35, 12 December 2021 (UTC)

To be honest, from the looks of it, the module is working perfectly fine. 2002_Waltham_Forest_London_Borough_Council_election#Results_by_ward is an empty table. 2022_Pennsylvania_House_of_Representatives_election#District_breakdown is an almost empty half table with 2 columns that duplicate their first section (and if needed could be represented a different way). From glancing at a few more, it seems that everywhere this error appears, the table using the module should either be removed completely or sections of it. Gonnym (talk) 08:05, 12 December 2021 (UTC)
I spot-checked a half-dozen of these and I agree with Gonnym in that they are serious GIGO issues; there is zero reason to have five entirely empty tables or (as linked above) an entire "second column" of templates that are entirely blank - the Pennsylvania election page, fwiw, has over 150 entirely blank calls to {{Election box inline candidate with party link no change}}. Primefac (talk) 09:02, 12 December 2021 (UTC)
A module that is working perfectly fine, IMHO, does not emit big red error messages where there was peaceful blank space in the past. I think we can treat our readers better by being a bit more elegant than that. – Jonesey95 (talk) 20:37, 12 December 2021 (UTC)
I don't necessarily disagree with you, but if "do nothing when there is zero input" is the output for the module, how do we know when it's being used improperly and/or something needs fixing? A lot of the pages that get flagged in that search have a blank "X party gains seats in the election", which in my opinion should be fixed and not ignored. Primefac (talk) 21:51, 12 December 2021 (UTC)
Let's output a maintenance category instead of a big red error message. – Jonesey95 (talk) 00:30, 13 December 2021 (UTC)
That might cause you lint errors or something. I'm not sure how all templates that use this module invoke it. I know that some use it inside a link, while there may be others which don't. Would something like [[[[Category:Error category]]]] cause lint (or other kinds of) errors? Gonnym (talk) 01:29, 13 December 2021 (UTC)
I think I have fixed the problem in one template just by checking for |party=. If someone wants to emit a maintenance category as part of the if statement that makes a wikilink (not the one that styles the cell), it should be straightforward. – Jonesey95 (talk) 02:47, 13 December 2021 (UTC)
I was just thinking about that! Allows for use of the error message when called directly, but when put through a template it can avoid those big messy all-table errors. Primefac (talk) 08:21, 13 December 2021 (UTC)
I fixed all 400+ of these errors with edits to 20 election templates. There sure are a lot of slightly different election templates. – Jonesey95 (talk) 14:18, 13 December 2021 (UTC)
No kidding. I feel like going through my conversion edits of the (literally) hundreds of election-related templates, one would find that 90% of them could be merged somewhere (reducing down the total number of templates to maaaaaaybe 20). Primefac (talk) 14:22, 13 December 2021 (UTC)

Default color handling

I noticed that Jonesey95 was adding a white color to some parties so the error at Module:Political party#L-81 won't appear. That error should probably be removed and we should let the module just return the default color instead of adding many default values just to remove that error. That brings me to the second issue, Template:/meta/color, the previous de-facto default color, used the color white. The default colors editors are adding to this module is also white. We should either change the default color to white or place a notice to stop editors adding manual default colors as white. The current system where we use two different default colors is just wrong. Gonnym (talk) 21:14, 12 December 2021 (UTC)

I think, similar to the "no party" issue in the section above, we need to determine what we actually want when there is an error. Do we want the editor to recognise that their colour is not in the template and ask that it be updated/added, or do we want to default to "give them the default table background"? On the matter of "which colour is default", I think somewhere in the initial discussions we decided that   (which is not white/ ) was more appropriate since it is the background colour of the tables in which this module is most-often used, so if people are going to just fill in missing colour values, I think we should be using #F8F9FA. Primefac (talk) 21:55, 12 December 2021 (UTC)
The default colour shouldn't be white, as this is the actual colour of some parties. I think we discussed this previously and agreed it should be the default background colour of wikitable cells. Number 57 22:24, 12 December 2021 (UTC)
I'm fine with a default background color instead of a manual "white" value. The problem I was trying to work around was a big red error and a broken div tag when there was an entry in "local full" with an abbrev but no color. An encyclopedia should not display that sort of horrorshow to casual readers. If the module can see 'color = ""' and output a default color, that would be fine. Visibly broken div tags are undesirable, however. – Jonesey95 (talk) 00:35, 13 December 2021 (UTC)
Then for colors we probably always want to return the default color instead of an error at line 81 (or a value the user requested if no color is available, i.e. args.error) and stop adding white "default" colors. Gonnym (talk) 01:25, 13 December 2021 (UTC)

Italian political parties

Could someone please change (or remove) the shortnames for Italian Communist Party, Italian Republican Party, etc. for all parties starting with "Italian"? I do not understand why the shortname for Italian Communist Party is just "Communist Party": it should not appear like this in the infoboxes and wherever the shortname is used. The word "Italian" is in fact always associated to it, even in Italian language (one would say partito comunista italiano or PCI, but very rarely one uses just partito comunista to refer to the PCI). The same is valid for all other parties starting with "Italian". Thanks, Yakme (talk) 13:37, 22 December 2021 (UTC)

The issue here is that the shortname templates have somehow been imported incorrectly; the shortname for the Italian Communist Party was PCI, but has ended up as "Communist Party", so I've changed it back to PCI.
A wider issue with your suggestion is that shortnames that are the full names of parties with not-very-short names are a bad idea, because they don't fit in infobox rows. The whole point of shortname function is to get a name short enough to use in an infobox.
Also, you should be able to edit these templates to change it yourself, no? Cheers, Number 57 16:33, 22 December 2021 (UTC)
Unfortunately Module:Political party/I and some others are template-protected and I am not allowed to edit. Anyway: PCI is the abbreviation, not the shortname so I agree with your edit (and I would extend it to all other similar "Italian ..." parties. --Yakme (talk) 08:25, 23 December 2021 (UTC)
I've downgraded the protection to ECP. If there are any others still with template editor protection, let me know.
Just to clarify on the terminology, the terms shortname and abbreviation are not literal. 'shortname' refers to the form of the short form of a party name used in infoboxes and Election box results tables (which can be a shortened name or an abbreviation). 'abbrev' refers to the very short form of the name used in some cells of tables. Unfortunately, due to the way the module was created, we are currently stuck with putting shortnames that are abbreviations in the abbreviation field (although they will show up in infoboxes if nothing is entered in the shortname field), but there is an RfC about fixing this above. Cheers, Number 57 09:53, 23 December 2021 (UTC)
But I see that only the abbreviation of Italian Communist Party has been converted into an acronym. I don't know if the abbreviated name or the acronym is more correct in the infoboxes, but surely there should be the same treatment for all parties of a country. Currently the acronym appears only for the Italian Communist Party, the other parties use the abbreviated name.--Scia Della Cometa (talk) 10:06, 23 December 2021 (UTC)
The same treatment is not required – what matters is how the parties are known. For the UK we have names for some, abbreviations for others (e.g. Labour and SNP).
This issue seems to have arisen because Nick.mon changed all the shortname templates for Italian parties in late September (from names to abbreviations in many cases), but these changes weren't picked up by the major import done before the templates started being deleted. You need to discuss between yourselves what the best names for parties are. Number 57 12:26, 23 December 2021 (UTC)

Thanks, Number 57. I am going to restore the "full" shortname for all these parties. I do not think that having the acronym is consistent with the treatment we have currently for all the rest of the Italian parties. I will keep the acronyms in the "abbrev" entry, because they are still useful in tables etc, and very much used. I guess this thread is a good place to discuss, if Nick.mon or Scia Della Cometa have something against what I just wrote. --Yakme (talk) 12:36, 23 December 2021 (UTC)

@Yakme: I think this is a very bad idea and will make the infoboxes look awful – please do not use the full party names. I believe Nick.mon converted most of them to abbreviations in September, but the module then reversed this as it wasn't updated properly. If you use the shortname field for Italian parties, the abbrev field will not be used anywhere, because as far as I can see, no /meta/abbrev templates were created for Italian parties (as their use is quite specific). Number 57 12:49, 23 December 2021 (UTC)
The infoboxes look fine to me now. It would be much worse to have the infoboxes show a bunch of obscure acronyms, which a non-Italian or a young Italian would never understand unless he/she clicks on the link. The full names are not that long anyway, they fit well within the election infoboxes. --Yakme (talk) 12:54, 23 December 2021 (UTC)
They don't to me. Multiple infoboxes have party names over two rows instead of one. Number 57 12:55, 23 December 2021 (UTC)
And that is not an issue at all. Clarity before prettiness. --Yakme (talk) 12:56, 23 December 2021 (UTC)
It is a problem, and you have no consensus to make these changes. Number 57 12:59, 23 December 2021 (UTC)
I never said I had consensus, I was just being WP:BOLD I guess it is allowed. --Yakme (talk) 13:02, 23 December 2021 (UTC)

I changed the shortnames some months ago using abbreviations because I thought they were better than "Communist Party", "Social Movement" and so on, but I could live with those too if there's a consensus. However, at the moment the Italian Communist Party is the only one shortened with the acronym and infoboxes look awful... -- Nick.mon (talk) 13:22, 23 December 2021 (UTC)

Personally, I too prefer shortened names like Socialist Party, Liberal Party etc. than full nouns. They are clear and in many cases avoid the second line. Surely the current situation is not ok, the Italian Communist Party uses the acronym and the other parties use the abbreviated name, a correction is needed.--Scia Della Cometa (talk) 15:53, 23 December 2021 (UTC)
Why not just 'Communist', 'Socialist', 'Liberal' etc, which is the case for many parties? Number 57 17:13, 23 December 2021 (UTC)
At this point it is still not clear to me what is the real purpose of shortname, full name and abbrev. If there is an ongoing RfC about this I would wait for its result to make a decision about what to insert in shortname for these parties. I think it is quite a demanding condition to impose the one by which no party can be shown in two lines in the infoboxes. Look at 1972 Italian general election where even Christian Democracy comes in two lines: What would you do with this? Have just "Christian"? Hopefully no. The decision would then be to have "DC", but then by consistency also all other parties should be shown with their acronym (PCI, PSI, PRI etc). And here another large problem comes, i.e. that not all parties in Italy have established acronyms like PCI, PD or DC or PSI. I still think that for now the full name is not that bad in the infobox. Note also that the "shortname" is used at the end of the election infoboxes (where previous and current PM are shown for example): in this case it would be extremely weird to have something like "Communist" or "Socialist" below the PM's name. At least in Italy one would put the full party name. Probably in order to solve this one would have to use "abbrev" in the first part of the infoboxes (where the results are) and "shortname" or something else wherever one needs the full name without parentheses (like "Democratic Party" instead of "Democratic Party (Italy)"). --Yakme (talk) 17:56, 23 December 2021 (UTC)
Of course it is impossible to always write party names in one line, unless acronyms are used. I meant that it would be best to avoid writing names in two lines whenever possible. Honestly, the adjective "Italian" seems to me a bit superfluous in infoboxes. Personally I'm not even against using acronyms. The proposal of Number 57, on the other hand, seems to me difficult to apply with some parties, especially recent ones, but also with some old parties (the "Italian Socialist Party of Proletarian Unity" or the "Democratic Party of the Left", for example). Anyway the issue about the PCI acronym should be fixed.--Scia Della Cometa (talk) 19:34, 23 December 2021 (UTC)
Regarding shortname and abbrevs: shortnames are used in election infoboxes and {{Election box}}. abbrevs are used in a very limited group of templates in cells where a very short name is wanted, for example where just "Lab" (as opposed to "Labour") appears in the table here. The names are not literal, but unfortunately were taken as such during the build of this module, hence we ended up with the contents of most /meta/shortname templates in the abbrev field. The RfC above is simply proposing that the module properly matches the old /meta/ templates (/meta/shortnane to shortname and /meta/abbrev to abbrev) which would avoid all this confusion (which is exactly what I was worried would happen). Number 57 19:52, 23 December 2021 (UTC)

Social Democratic Party (Nigeria)

["Social Democratic Party (Nigeria)"] = {abbrev = "", color = "#e67819 ", shortname = "",}, Could you change the party color to #e67819, it primarily uses orange. Watercheetah99 (talk) 08:00, 30 December 2021 (UTC)

 Done Number 57 13:17, 3 January 2022 (UTC)

I've started a discussion at Template talk:NZ parlbox#Changing from text on color (shading) to two cell style which can use input from editors here. Gonnym (talk) 10:53, 30 December 2021 (UTC)

Bahujan Vikas Aaghadi

@Number 57 Would you be able to add an entry for Bahujan Vikas Aaghadi. There's an entry for "Bahujan Vikas Aghadi" (single a in Aaghadi), a redirect to the article? Thanks! — DaxServer (talk) 15:29, 5 January 2022 (UTC)

@DaxServer: Done. If you want to add the equivalent of a redirect to the correct name, you do it like this. Cheers, Number 57 15:52, 5 January 2022 (UTC)
Thanks @Number 57 :) — DaxServer (talk) 16:00, 5 January 2022 (UTC)

Party name change

Please change the name of ["Partido Demokratiko Sosyalista ng Pilipinas"] = {abbrev = "", color = "#CD5C5C", shortname = "PDSP",} to ["Philippine Democratic Socialist Party"] = {abbrev = "", color = "#CD5C5C", shortname = "PDSP",} as per name change in the said article. NewManila2000 (talk) 05:54, 8 January 2022 (UTC)

 Done The Philippine Democratic Socialist Party article says the abbreviation is PDSP and not the shortname. I've added as such. Special:Diff/1064437817DaxServer (talk) 10:04, 8 January 2022 (UTC)


Template-protected edit request on 8 January 2021

I request that

	["Liberal/Country coalition"] = "Liberal Party of Australia",
	["Liberal/National coalition"] = "Liberal Party of Australia",
	["Liberal/NCP coalition"] = "Liberal Party of Australia",

be changed to

	["Liberal/Country coalition"] = {abbrev = "", color = "#0047AB", shortname = "",},
	["Liberal/National coalition"] = {abbrev = "", color = "#0047AB", shortname = "",},
	["Liberal/NCP coalition"] = {abbrev = "", color = "#0047AB", shortname = "",},

and moved to the main list of Module:Political party/L as full entries. These entities used to have their own colour templates, and they should still be separate entries. The Coalition is a distinct entity, and should be treated as such. The current code is causing many infoboxes (such as here) to be inaccurate, saying only the Liberals contested an election, not the Coalition. YttriumShrew (talk) 08:25, 8 January 2022 (UTC)

Not done: According to the page's protection level you should be able to edit the page yourself. If you seem to be unable to, please reopen the request with further details. I just dropped from TPE to ECP. Primefac (talk) 15:43, 8 January 2022 (UTC) Done, see below
Oops, I edit-conflicted with Primefac and carried out the request. Elli (talk | contribs) 15:44, 8 January 2022 (UTC)
No worries, my concern was more for the drop to ECP. Primefac (talk) 15:50, 8 January 2022 (UTC)

Template-protected edit request on 8 January 2021 - UK Parliament colour

I request that the following be added:

	["Parliament of the United Kingdom"] = {abbrev = "UK Parliament", color = "#373151", shortname = "",},

to Module:Political party/P. This reflects the newest logo (at File:UK Parliament logo 2018.png) of the UK Parliament, and their wider new visual brand, that has been in use since 2018. There are already party colours for the House of Commons, House of Lords etc, so I don't foresee this being an issue. PointUnderstander (talk) 15:40, 8 January 2022 (UTC)

Genuinely curious, PointUnderstander, but when would "Parliament of the United Kingdom" be used as a parameter for any template that calls this module? Primefac (talk) 15:48, 8 January 2022 (UTC)
House of Commons of the United Kingdom calls this module for the background colour on its infobox, as does House of Lords of the United Kingdom. I'm trying to make it so Parliament of the United Kingdom does the same. I am relatively new to Wikipedia editing, so if there's something I've got wrong here I'm happy to be corrected. PointUnderstander (talk) 15:51, 8 January 2022 (UTC)
 Partly done: That's a shortname, not an abbrev, but otherwise it's done. Primefac (talk) 15:57, 8 January 2022 (UTC)
Excellent, many thanks! PointUnderstander (talk) 15:59, 8 January 2022 (UTC)

Template protection

/D is still template-protected. In addition, /Q and /X are unprotected, while /Y, /Z, and /1 are semi-protected. All other subpages are ECPed.

Please ping me after downgrading the protection of /D, I'd like to edit it.

Streded (talk) 05:28, 9 January 2022 (UTC)

 Done. Primefac (talk) 19:32, 9 January 2022 (UTC)