Module talk:European and national party data
Links to archive: Archive 1, Archive 2, Archive 3
Roadmap: translation
[edit]Next steps:
- Translate French config file
- Find way to adapt to local structures of wikidata/wd and composition bar modules (in French sandbox)
Task | Completion | Comments | ||||||
---|---|---|---|---|---|---|---|---|
EN | FR | DE | NL | IT | ES | PT | ||
Tests | N/A | Utilisateur | Community not interested | Gebruiker | Utente | Usuario | Usuário | |
Create module, config file, three templates | ✅ module config sandbox |
✅ module config sandbox |
✅ module config |
✅ module config |
✅ module config |
✅ module config sandbox |
||
Validate module and templates | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| |
Translate config file | N/A | ⚠️ | ❌ | ❌ | ❌ | ✅ | ||
Add untranslated documentation to module | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ||
Translate module documentation | N/A | ❌ | ❌ | ❌ | ❌ | ✅ | ||
Add untranslated documentation to templates | N/A | ❌ | ❌ | ❌ | ❌ | ✅ | ||
Translate template documentation | N/A | ❌ | ❌ | ❌ | ❌ | ✅ | ||
Add testcases | ✅ testcases comp bar |
❌ | ❌ | ❌ | ❌ | ✅ testcases comp bar |
||
Deploy templates to EUPPs/EUPAs | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ||
Deploy templates to national parties | ⚠️ | ❌ | ❌ | ❌ | ❌ | ⚠️ Discussion to propose change |
||
🏆 | 🏆 |
Reference files:
- Synchronizer: Synchronizer
- Module
- Module sandbox
- Templates
- Wikidata items
- Other
- Table mapping national parties to their European party of membership (also used to link a party or member state to its lower and upper houses)
- Module config file
Issues with national party seats in national legislatures
[edit]Hey @Trappist the monk, how are you? I am working on the translation of the module to use it across various Wikis, wanna help? I think key will be to find a way to localise the calls to Wikidata.
But a lower-hanging fruit is the case of Portugal, where the calls to wikidata and the composition bar are quite compatible with the English version. As you can see here and here, most tests work. The ones that don't seem to only concern the number of seats of national parties (called with their qIDs in the tests) in national legislatures, which would concern the function npp_seats_and_seat_share_in_national_institutions
. However, I am not quite seeing what could be breaking it. Any ideas? Julius Schwarz (talk) 08:57, 24 April 2025 (UTC)
- Ok, I am thinking that the member state name may be translated. I am going to try and move from using the member state's name to its qID. Julius Schwarz (talk) 09:13, 24 April 2025 (UTC)
- Yes, that was it and I added european_party_qid and member_state_qid to the online table, in order to run checks on qIDs instead of on names. Julius Schwarz (talk) 13:06, 24 April 2025 (UTC)
- A quick look at de:Modul:Wikidata, es:Módulo:Wikidata, fr:Module:Wikidata, it:Modulo:Wikidata, nl:Module:Wikidata, pt:Módulo:Wikidata seems to show that while there may be similarities among them, they do not appear to be the same as en:Module:Wikidata. I suspect that the politics necessary to unify these modules would be a daunting task. Perhaps the better solution is to roll-your-own access to wikidata using the mw.wikibase library. Such documentation as there is for that is at https://doc.wikimedia.org/Wikibase/master/php/docs_topics_lua.html.
- Similarly, you might also create a custom lua version of
{{composition bar}}
so that you avoid anomalous variations that might crop up at the various wiki language editions. - —Trappist the monk (talk) 22:18, 24 April 2025 (UTC)
- Thanks @Trappist the monk, I can look into that, but that seems daunting too. I was kind of hoping that with a nice if conditionality on the language, we could spread the arguments as needed based on per-Wiki structures. But I will check your link.
- The composition bar point is probably less feasible, since this template would most likely be sitting next to other composition bars and would therefore really need to look the exact same. Julius Schwarz (talk) 11:31, 25 April 2025 (UTC)
Preventing error message inside composition bar
[edit]Hi @Trappist the monk, I have made some good progress on the translation of arguments and parameters, and that should pretty much be ready. Doesn't solve the wikidata/composition bar template implementation issue just yet, but at least I can test deploy to Portuguese Wikipedia (which so far seems to work, see testcases composition bar).
One separate issue that I have is as follows (in the sandbox): when I ask for the number of seats of a party where Wikidata does not have that information, the function returns an error message, as it should. For instance (note: maybe no longer the best error message, but that's a separate issue):
*{{#invoke:European and national party data|main|national_party|seats|Q173152|ep}}
->Error: {{European and national party data}}: institution EP has unknown party: Q173152 (help)
However, when I call the same function to retrieve that number for the purpose of a composition bar, then I should not have that error message returned, and instead just have the composition bar function itself return an error. I have tried to make this work, but no to avail. Any ideas?
{{#invoke:European and national party data/sandbox|main|national_party|seat composition bar|Q173152|ep}}
-> Error: {{European and national party data}}: institution EP has unknown party: Q173152 (help)
Julius Schwarz (talk) 12:47, 29 April 2025 (UTC)
- You can have the code that returns the error messages from allpp_seats_in_eu_institutions() return a second value (a boolean) so, at line 457 this (line 459 similar):
return make_error_msg (substitute (cfg.error_messages_t.party_req_share)), true;
- Then, change line 740 to this:
local has_error; party_seats, has_error = allpp_seats_in_eu_institutions (frame, party, institution, cfg.body_prop_t[institution]); if has_error then return party_seats; -- <party_seats> has an error message end
- —Trappist the monk (talk) 13:46, 29 April 2025 (UTC)
- Thanks for the quick feedback, @Trappist the monk. However, I am not sure this is working. I made the changes, but I am not seeing a change in the testcases page. Did I not do it right? Julius Schwarz (talk) 14:00, 29 April 2025 (UTC)
- I changed your example above to remove the
<nowiki>...</nowiki>
tags and to use the sandbox. Looks like it's working correctly – shows the module's error message, not the MediaWiki error messages. But, your testcases page is calling the live version of the module not the sandbox. - —Trappist the monk (talk) 14:20, 29 April 2025 (UTC)
- Ah yes, indeed. Thanks a lot! Julius Schwarz (talk) 14:30, 29 April 2025 (UTC)
- I changed your example above to remove the
- Thanks for the quick feedback, @Trappist the monk. However, I am not sure this is working. I made the changes, but I am not seeing a change in the testcases page. Did I not do it right? Julius Schwarz (talk) 14:00, 29 April 2025 (UTC)