Content deleted Content added
→Guinea-Bissau error: check first |
→Guinea-Bissau error: Details |
||
Line 237:
::::It's to handle the format <code><COUNTRY>-<SUBDIVISION></code>, like 'United Kingdom-England' — [[User:Wqnvlz|wqnvlz]] ([[User talk:Wqnvlz|talk]] '''·''' [[Special:Contributions/Wqnvlz|contribs]]) 17:08, 31 March 2022 (UTC)
:::::It looks like the code should check to see if "Xxxx-Yyyy" matches a valid country name first, then fall back to "Country-Subdivision". – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:31, 31 March 2022 (UTC)
:Continued from the [[WP:VPT#Help needed at Module talk:ISO 3166|this]] discussion.
:Let's try to finish up the fix for this so it can be used [[WP:Request a query#Map of countries by GAs/FAs per capita|where it was discovered]].
:*I made some more fixes. The [[Module talk:ISO 3166/testcases|tests page]] shows what has and hasn't changed (some older cases are commented out for runtime).
:*Hyphens are now significant, so input like 'GuineaBissau' no longer works. However, I'm not sure if this is really desired because quite a few subdivisions have hyphenated names that look like they might be used with spaces informally. For example, I can see one instance in the refs of [[Stoke-on-Trent]].
:**For reference, {{sl |insource:/[A-z]-[A-z]/ prefix:Module:ISO 3166/data |here's a search}} for all hyphenated names in the data
:*Even though the top-level behaviour as seen in the tests remains largely unchanged, some of the underlying functions now handle things like <code>nil</code> vs <code>'<nowiki />'</code> differently. This might break direct invocations in other modules/templates (Hyrum's law, I suppose). Some searches for invocations:
:**{{sl |module: insource:"Module ISO 3166" |in modules}}
:**{{sl |template: insource:"invoke ISO 3166" |in templates}}
:**{{sl |all: insource:"invoke ISO 3166" |everywhere}}
:*An error message that wasn't showing up now does—is this desirable or are we relying on the template to fail silently? There are other cases that still don't have messages.
:*Profiling time varies widely; the testcase page is around 6 s with only main and 2 s with only sandbox.
: — [[User:Wqnvlz|wqnvlz]] ([[User talk:Wqnvlz|talk]] '''·''' [[Special:Contributions/Wqnvlz|contribs]]) 01:23, 2 April 2022 (UTC)
|