![]() | Text and/or other creative content from this version of Module:Wd was copied or moved into Module:European and national party data/Wd with this edit on 22 May 2025. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
|
|||
Next steps:
date foundation age
Task | Completion | Comments | |||||||
---|---|---|---|---|---|---|---|---|---|
EN | FR | DE | NL | IT | ES | PT | SL | ||
Tests | N/A | Utilisateur | Community not interested | Gebruiker | Utente | Usuario | Usuário | Uporabnik | |
Create module, config file | ✅ module config |
✅ module config |
✅ module config |
✅ module config |
✅ module config |
✅ module config |
✅ module config |
||
Create sandbox and testcases | ✅ sandbox testcases comp bar |
✅ sandbox testcases comp bar |
✅ sandbox testcases comp bar |
✅ sandbox testcases comp bar |
✅ sandbox testcases comp bar |
✅ sandbox testcases comp bar |
✅ sandbox |
||
Create Wd module | ✅ Wd i18n |
✅ Wd i18n |
✅ Wd i18n |
✅ Wd i18n |
✅ Wd i18n |
✅ Wd i18n |
✅ Wd i18n |
||
Add module testcases | ✅ testcases comp bar |
✅ testcases comp bar |
⚠️ | ✅ testcases comp bar |
✅ testcases comp bar |
✅ testcases comp bar |
✅ testcases comp bar |
NL: testcases not working? | |
Translate config file | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | Done locally | ||
Validate module | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ||
Add untranslated documentation to module | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | Done locally | ||
Translate module documentation | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | Done locally | ||
Create three templates | ✅ EUPP data PP data Inst. seats |
✅ EUPP data PP data Inst. seats |
✅ EUPP data PP data Inst. seats |
✅ EUPP data PP data Inst. seats |
⚠️ EUPP data PP data Inst. seats |
✅ EUPP data PP data Inst. seats |
✅ EUPP data PP data Inst. seats |
⚠️ ES - templates currently in user space | |
Add untranslated documentation to templates | N/A | ✅ | ✅ | ✅ | ⚠️ | ✅ | Done locally | ||
Translate template documentation | N/A | ✅ | ✅ | ✅ | ⚠️ | ✅ | Done locally | ||
Validate templates | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | ✅ | ||
Deploy templates to EUPPs/EUPAs | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ||
Deploy templates to national parties | ✅ | ✅ | ⚠️ Discussion here and here to propose change |
⚠️ Discussion to propose change |
⚠️ Discussion to use templates |
⚠️ Discussion to propose change |
Done locally | ||
🏆 | 🏆 | 🏆 | 🏆 | ⚠️ | 🏆 | 🏆 |
Task | Completion | Comments | |||||||
---|---|---|---|---|---|---|---|---|---|
EN | FR | DE | NL | IT | ES | PT | SL | ||
EUPP article | ✅ | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | Incl. for tables |
Funding EUPP article | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | |
EUPA article | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | |
European political parties -- incl. tables of members | ✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
N/A | ✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
✅ ALDE ✅ ECPP ✅ ECR ✅ EDP ✅ EGP ✅ EFA ✅ EL ✅ ELA ✅ EPP ✅ ESN ✅ Patriots ✅ PES |
|
European political alliances -- incl. tables of members | ✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
N/A | ✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
✅ APEU ✅ ECA ✅ DIEM25 ✅ PPEU ✅ Volt |
|
National political parties | ✅ AT ✅ BE ✅ BG ✅ HR ✅ CY ✅ CZ ✅ DK ✅ EE ✅ FI ✅ FR ✅ DE ✅ GR ✅ HU ✅ IE ✅ IT ✅ LV ✅ LT ✅ LU ✅ MT ✅ NL ✅ PL ✅ PT ✅ RO ✅ SK ✅ SI ✅ ES ✅ SE |
✅ AT ✅ BE ✅ BG ✅ HR ✅ CY ✅ CZ ✅ DK ✅ EE ✅ FI ✅ FR ✅ DE ✅ GR ✅ HU ✅ IE ✅ IT ✅ LV ✅ LT ✅ LU ✅ MT ✅ NL ✅ PL ✅ PT ✅ RO ✅ SK ✅ SI ✅ ES ✅ SE |
N/A | ❌ AT ❌ BE ❌ BG ❌ HR ❌ CY ❌ CZ ❌ DK ❌ EE ❌ FI ✅ FR ❌ DE ❌ GR ❌ HU ❌ IE ✅ IT ❌ LV ❌ LT ❌ LU ❌ MT ✅ NL ❌ PL ✅ PT ❌ RO ❌ SK ❌ SI ❌ ES ❌ SE |
❌ AT ❌ BE ❌ BG ❌ HR ❌ CY ❌ CZ ❌ DK ❌ EE ❌ FI ✅ FR ❌ DE ❌ GR ❌ HU ❌ IE ✅ IT ❌ LV ❌ LT ❌ LU ❌ MT ✅ NL ❌ PL ✅ PT ❌ RO ❌ SK ❌ SI ❌ ES ❌ SE |
❌ AT ❌ BE ❌ BG ❌ HR ❌ CY ❌ CZ ❌ DK ❌ EE ❌ FI ❌ FR ❌ DE ❌ GR ❌ HU ❌ IE ❌ IT ❌ LV ❌ LT ❌ LU ❌ MT ❌ NL ❌ PL ❌ PT ❌ RO ❌ SK ❌ SI ❌ ES ❌ SE |
❌ AT ❌ BE ❌ BG ❌ HR ❌ CY ❌ CZ ❌ DK ❌ EE ❌ FI ✅ FR ❌ DE ❌ GR ❌ HU ❌ IE ✅ IT ❌ LV ❌ LT ❌ LU ❌ MT ✅ NL ❌ PL ✅ PT ❌ RO ❌ SK ❌ SI ❌ ES ❌ SE |
❌ AT ❌ BE ❌ BG ❌ HR ❌ CY ❌ CZ ❌ DK ❌ EE ❌ FI ❌ FR ❌ DE ❌ GR ❌ HU ❌ IE ❌ IT ❌ LV ❌ LT ❌ LU ❌ MT ❌ NL ❌ PL ❌ PT ❌ RO ❌ SK ❌ SI ❌ ES ❌ SE |
|
Other articles | ✅ European Council | N/A | |||||||
🏆 | 🏆 | N/A | ⚠️ | ⚠️ | ⚠️ | ⚠️ | 🏆 |
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)
{{composition bar}}
so that you avoid anomalous variations that might crop up at the various wiki language editions.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)
return make_error_msg (substitute (cfg.error_messages_t.party_req_share)), true;
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
<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.Hi @Trappist the monk, so the translation of parameters and arguments now works, and I am just getting to the translation of the calls to wd/wikidata and composition_bar templates. I wrote a xlate_wikidata function in the sandbox and will test it early next week. Would you mind having a quick look to see whether this at least has the possibility of working? That would be helpful. Thanks a lot! Note: the idea is to develop the function in the English wikipedia, to make sure that it does not break anything with the current module, and then to move it to the French Wikipedia to work on adding another language. Julius Schwarz (talk) 14:31, 2 May 2025 (UTC)
args_t
. Are you saying that {{wikidata}}
takes a lua sequence as its options positional parameter? Are you sure about that?if 'en' == cfg.this_project_language then
this_project_language
also go away.{{#invoke:European and national party data/sandbox|main|european_entity|seats|EPP|EC}}
returns 11, which is right, but it is also the first preferred value for seats here;{{#invoke:European and national party data/sandbox|main|european_entity|seats|PES|EP}}
returns 4, which is false, but it is the first preferred value here, under a different qualifier;{{#invoke:European and national party data/sandbox|main|european_entity|seats|EPP|EC}}
xlate_wikidata()
takes that and, at line 154 creates a table for args
that (to lua) looks like this:
args = {
[1] = "property",
[2] = "Q208242",
[3] = "P1410",
["qualifier_id"] = "Q8880",
}
args["qualifier_id"]
is not what you wanted. Rather, did you not want:
args = {
[1] = "property",
[2] = "Q208242",
[3] = "P1410",
["P208"] = "Q8880",
}
return frame:expandTemplate ({title='wikidata', args = {data_requested, qid, property_id, [qualifier_id] = value_of_qualifier}});
frame:expandTemplate ({title='wikidata', args = {....}});
, but how does one call a module? Julius Schwarz (talk) 14:25, 7 May 2025 (UTC)
{{cite book}}
, {{cite web}}
, etc) has not been callable from another module. At its most recent update, Module:Citation/CS1 became callable. {{cite tweet}}
is a template that wraps {{cite web}}
by way of Module:Cite tweet which now calls Module:Citation/CS1.citation
is the entry point for the {{#invoke:}}
in {{cite book}}
and the other native cs1|2 templates. _citation
is the entry point for use by other modules.{{cite tweet}}
calls main()
in Module:Cite tweet at line line 103. The code fiddles about collecting and formatting parameter values and stuff until at line 146 it calls _citation
in Module:Citation/CS1 to get a rendered citation.xlate_wikidata
function in the French sandbox (see testcases), that would be great! Julius Schwarz (talk) 14:57, 7 May 2025 (UTC)
this_project_language
from fr:Module:European and national party data/config? Should the fr.wiki version of that module be the same as the en.wiki version?test2
calls xlate_wikidata
; it takes a party_qid and a property and should return the qID of the response. On fr:Utilisateur:Julius Schwarz/Brouillon, you see that the template gives out the right output, but test2
does not. Instead it display "displayformat = raw", which should just be sent to the {{Wikidata}}
template. Any idea why?xlate_wikidata
, we do a check to see whether value_of_qualifier
is nil
or not. However, even when it is nil
(as, for instance, it is in the test2
function), it still seem considered as not nil
(like if you change the return value in the if nil ~= value_of_qualifier
case, this is what will be returned by test2
). Any idea why?test2()
looks like this:
return xlate_wikidata (frame, 'property', qid, property, '', '', 'reference=no', 'preferred=no', 'raw=yes', 'linked=no');
if local_raw == 'raw=yes' then local_raw = 'raw' else local_raw = '' end;
(same as line 162)local_raw
with ['displayformat'] = local_raw
; similar replacements in the other template expansions.nil
. In the call in test2()
, the sixth parameter, value_of_qualifier
, is set to empty string. If you want that value to be nil
, you must explicitly set it to nil
:
return xlate_wikidata (frame, 'property', qid, property, '', nil, 'reference=no', 'preferred=no', 'raw=yes', 'linked=no');
Hey @Trappist the monk, I just finished rolling out the French version, and am starting the Italian one, so things are moving forward. Say, in a previous question, you had opined that, since templates were different from wiki to wiki, maybe the better solution would be to roll-our-own access to wikidata using the mw.wikibase library.
While I continue to think that this should not apply to the composition_bar templates (so that we keep wikis' respective look and feel) and that doing this for the wikidata templates is above my competencies, I do agree that this would make things easier in the longer run -- for instance, the different implementation in fr-wiki means that several options (reference, width, bar-color, etc.) are not available, which is unfortunate. So I was wondering: is this something that you might consider doing? I would be really useful help! Julius Schwarz (talk) 15:12, 13 May 2025 (UTC)
{{cite q}}
which I will tweak when I have to but otherwise prefer to ignore).xlate_wikidata
function.require()
modules.mw.wikibase
, correct? Julius Schwarz (talk) 13:17, 23 May 2025 (UTC)
Hi @Ahecht, thanks again for the help; I am just getting to this now. Following @Trappist the monk's message above, I created "/Wd" modules across all relevant wikis. Once that was done, I got an error saying that a "/Wd/i18n" module was also needed, which I understand is for translation. So I went ahead and created those in all relevant wikis (and I will have to localise them).
Now the testcases for en-wiki are working. However, when I try the pt-wiki testcases, for instance, i am told "module 'Module:European_and_national_party_data/Wd/i18n' not found", which is somewhat normal since a module in Portuguese is called "modúlo".
However, it would seem, from the code of the /Wd module that "/i18n" is just slapped at the end of whatever the current module is called (in the loadI18n
function), which should get the Portuguese name, shouldn't it?
Finally, I note that, in the testcases, line 6 says that it does not recognise the local version of "lower house" ("camara baixa"), which seems to indicate that the translated version doesn't get picked in the /config file; is that what is happening?
Thanks a lot in advance for your help as I get my bearings on the new system :) Julius Schwarz (talk) 07:51, 26 May 2025 (UTC)
Hi @Trappist the monk @Ahecht, very small issue: I think the call to get the "individual members date" no longer works since the move to the own implementation of the calls to Wikidata. I made a test here and it is not showing up, neither is it showing up on pages such as here, while I think it did. Any idea why? It's defined around line 324 in the module.
Actually, I was trying to find a way to only return the year (by adding something like "individual members year"; how would one do that? Julius Schwarz (talk) 21:14, 29 May 2025 (UTC)
=mw.dumpObject (mw.wikibase.getEntity ('Q208242').claims.P2124[1].qualifiers.P585[1].datavalue.value.time)
→ +2022-12-31T00:00:00Z
string.match ('+2022-12-31T00:00:00Z', '%d%d%d%d')
xlate_wikidata
/Wd
function, which does not have this format, but maybe I can also try and extract a four-digit string from the result. It just feels a bit hacky, when Wikidata has a date/time system that includes levels of precision, which would feel cleaner. Julius Schwarz (talk) 14:32, 3 June 2025 (UTC)xlate_wikidata("qualifier", "Q208242", "P2124", "P585", "", "reference=no", "preferred=yes", "raw=no", "linked=no")
, which in turn calls require('Module:European_and_national_party_data/Wd')['qualifier']({"", "preferred", "", "", "Q208242", "P2124"})
. Since value_of_qualifier
is "", the qualifier ID is not being sent to Wd
, and therefore nothing is being returned. --Ahecht (TALKvalue_of_qualifier
, since this is what we are trying to grab. Julius Schwarz (talk) 20:17, 3 June 2025 (UTC)
value_of_qualifier
was blank. Since the fifth parameter is ""
, it didn't include P585
. --Ahecht (TALK