Template talk:Bku

Latest comment: 5 years ago by MSGJ in topic Order of parameters
WikiProject iconBasketball Template‑class
WikiProject iconThis template is within the scope of WikiProject Basketball, a collaborative effort to improve the coverage of Basketball on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Order of parameters edit

Now with regards to this nomination, Pelmeen10 the reason that this is an issue has to do with the way other templates interact with these. Specifically I came across the issue when using {{Medals table}}. What this template does is take two params {{{flag_template}}} & {{{event}}}. These parmas are used in conjunction with the various 3 letter nation codes to produce things like {{flagIOC2team|GRE|2004 Summer}} where flag_template = flagIOC2team and event = 2004 Summer. So far, every single flag template I have come across is setup in the format {{<template_name>|<country_code>|<optional_descriptor>}}. The only exceptions that I have found so far are {{bku}} and {{Fbwu}}. I don't doubt there are others. So what I am proposing is that we try to keep things consistent. Instead of being formatted as {{bku|<descriptor>|<country_code>}}, I propose flipping this around to be {{bku|<country_code>|<descriptor>}}. The template only has 277 transclusions at the moment and most of those are within medal tables that I will be cleaning up as part of converting them to use {{Medals table}} anyway so I would gladly take responsibility for updating every single transclusion of the template but I want to make sure that I do so after a discussion has been had. --Zackmann (Talk to me/What I been doing) 16:23, 28 September 2018 (UTC)Reply

I did some random checks and it does indeed seem that the nation code always appears first. I would support this change. But how can you change the template without breaking all those uses and how can you change the uses wthout first updating the template? I can put some code into the template so that a number will always be interpreted as the first parameter. I assume that in men's national under-NNN basketball team the NNN will always be a number? That would allow you to change all 277 uses and then we can fix the template for good. Thoughts? — Martin (MSGJ · talk) 06:54, 12 October 2018 (UTC)Reply
@Zackmann08: — Martin (MSGJ · talk) 19:08, 14 October 2018 (UTC)Reply
@MSGJ: that is a great question... So there are a few ways to do this. First, there are only 276 transclusions of this template. So it wouldbe totally practical to change the template and then do a quick WP:AWB clean up to fix the broken ones. They would really only be broken for a few minutes, and with caching, you probably wouldn't even notice. The second solution, which would take a bit longer, would be a multi step process. I've already created a {{bku2}} which works the way you and I seem to agree this template SHOULD work. So we could basically convert all the transclusions of {{bku}} over to using {{bku2}}, then fix {{bku}}, redirect {{bku2}} to {{bku}} and then change all transclusions to use {{bku}}. I don't think that the longer process is really needed... If you are in agreement, I am happy to handle this myself with a WP:AWB script. Let me know! :) --Zackmann (Talk to me/What I been doing) 19:13, 14 October 2018 (UTC)Reply
Okay, please go ahead. But you didn't comment on my proposed method by detecting numbers. — Martin (MSGJ · talk) 19:16, 14 October 2018 (UTC)Reply
@MSGJ: Sorry!! Totally overlooked that. Can you elaborate on what it is you are suggesting? Perhaps mock it up in the sandbox? I don't entirely understand what you are getting at but you seem to be onto to something. --Zackmann (Talk to me/What I been doing) 19:44, 14 October 2018 (UTC)Reply
Hi, please see Template:Bku/testcases — Martin (MSGJ · talk) 20:58, 14 October 2018 (UTC)Reply