Module talk:Country population

Static Row Numbers
Hey,, would srn be useful in this module? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 21:59, 2 May 2021 (UTC)
 * FYI, you can't just add templates or tags to wikitext output generated in a module, as they won't expand properly. You need to use  or
 * P.S. I don't think the template srn is a good idea. It's to short to make it clear what it does and looks like one of the short note citation template, which could confuse people. Better to use the full template name which gives an indication of what it is doing. —  Jts1882 &#124; talk 08:56, 5 May 2021 (UTC)
 * Ok. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 09:06, 5 May 2021 (UTC)
 * Ok. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 09:06, 5 May 2021 (UTC)

Bottom alignment

 * Rows seem to be valigned to the bottom. I had a look at the code, and could only find bottom alignment for the header row, which is fine. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 01:07, 5 May 2021 (UTC)

Flaglist vs Flagcountry

 * Wouldn't flaglist be better for alignment than flagcountry here? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 01:28, 5 May 2021 (UTC)

Template wrapper
I started a template wrapper for this module bc I wanted to pass the list of countries as a template (like the List of countries in South America), bc the MW engine processes modules before templates. The main function here is commented with called from template, but I got stuck passing through the arguments. Did you already create the template you referred to there,, or can you help me beat that one into shape? Cheers. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 ☎ 08:17, 13 June 2021 (UTC)


 * The main function wasn't doing anything. The module was using p.populations.
 * When a module is called directly from #invoke the arguments are in frame.args. The function p.populations uses these frame arguments. I've split p.populations to have an entry point for invoke that gets the frame arguments and calls p._populations to generate the table.
 * When called from a template the arguments are in the parent frame. I've changed main to get the parent frame arguments and then call p._populations so it now seems to work for the template. Not an ideal approach but an easy change for now. —  Jts1882 &#124; talk 10:04, 13 June 2021 (UTC)


 * I wonder what I need to do to get this to work:


 * Yeah, well, I know it works like thatbut what I really wanted was:
 * The motive here is replicating the good work you did with Country populations to, say, Country areas, Country densities, etc, so that the list of countries in each region could be centrally maintained in a single template for each. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 ☎ 21:59, 13 June 2021 (UTC)
 * The problem there is that the result of that is to set parameter 1.
 * I don't think you can use a template to supply a series of parameters. The solutions is to get the module to handle a list (e.g. comma delimited). If the module is handling it, then the lists may as well be stored in a subpage and be provided a via a parameter, e.g. undefined. —  Jts1882 &#124; talk 08:24, 14 June 2021 (UTC)
 * The problem there is that the result of that is to set parameter 1.
 * I don't think you can use a template to supply a series of parameters. The solutions is to get the module to handle a list (e.g. comma delimited). If the module is handling it, then the lists may as well be stored in a subpage and be provided a via a parameter, e.g. undefined. —  Jts1882 &#124; talk 08:24, 14 June 2021 (UTC)

The above table is generated with. The list of countries is stored in a table as follows: local country_lists = { ['South America'] = { "ARG","BOL","BRA","CHL","COL","ECU","GUY","PRY","PER","SUR","URY","VEN","BVT","FLK","SGS","GUF" }, ['North America'] = { "ATG","BHS","BLZ","BRB","CAN","CRI","CUB","DMA","DOM","GRD","GTM","HND","HTI","JAM","KNA","LCA","MEX","NIC","PAN","SLV","TTO","USA","VCT" }, ['Arab countries'] = { "EGY","DZA","SDN","IRQ","MAR","SAU","YEM","SYR","TUN","JOR","ARE","LBN","LBY","PSE","OMN","KWT","MRT","QAT","BHR","DJI","COM" } } At the moment it is just a local variable in the function, but I suggest putting them in a subpage of the module. Then the subpage can be used by other modules. —  Jts1882 &#124; talk 16:26, 14 June 2021 (UTC)


 * Yep, that's useful. Unfortunately, the other aim I had in mind no worky — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 ☎ 06:05, 15 June 2021 (UTC)

Bug
Something's gone awry with the module,. Look at the missing 2nd figures column heading, and that the projected populations are lower than the latest (2019) estimate: List of African countries by population. Cheers. — Guarapiranga ☎ 03:20, 29 July 2021 (UTC)
 * The module gets the dates and data from List of countries by population (United Nations). You changed the section labels with this edit, so the date calculations no longer work correctly. You can also see that the first date column header is missing in List of African countries by population. —  Jts1882 &#124; talk 07:09, 29 July 2021 (UTC)


 * Yes, and additionally in List of African countries by population, Guinea-Bissau is missing. Does anyone know what is causing this bug? I wasn't able to follow the explanation above. I can't see anything problematic in the UN source list. Cstanford.math (talk) 19:19, 2 September 2021 (UTC)
 * . The section labels weren't set properly in the page with the population data (List of countries by population (United Nations)). I've set them now (with this edit) and the previous module version of List of African countries by population seems to work (you may need to display it in edit preview due to caching). —  Jts1882 &#124; talk 07:22, 3 September 2021 (UTC)