Wikipedia:User scripts/Requests/Archive 5
![]() | This is an archive of past discussions on Wikipedia:User scripts/Requests. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current main page. |
Archive 1 | ← | Archive 3 | Archive 4 | Archive 5 | Archive 6 | Archive 7 | → | Archive 9 |
Eswatini vs. Swaziland sortkeys
Hello!
The country of Swaziland changed its name to Eswatini in 2018. Nearly all Wikipedia articles and categories that needed renaming have been moved to the new name, see e.g. Wikipedia:Categories for discussion/Log/2018 November 5 § Swaziland.
However, I noticed that this renaming may have left sortkeys that need correction. E.g. I found Category:Wealth in Eswatini in Category:Wealth by country and Category:Wealth in Africa with sortkey Swaziland
, which left Eswatini in sequence between Sri Lanka and Sweden. I corrected them manually to Eswatini
.
Is there a way to find all such sortkeys and have them corrected by a bot? That's how I would do it:
- Look for every article or category that has
Eswatini
as part of its name - Look for category sortkey (found by
[[Category:<whatever>|<sortkey>]]
, sometimes small-casecategory
) or defaultsort ({{DEFAULTSORT:<sortkey>}}
):- If exactly
Swaziland
or a prefix (such asSw
orSwaz
, except just the letterS
), replace byEswatini
exactly - If a longer sortkey includes
Swaziland
, not necessarily in the beginning (such asSwaziland, Economy of
orEconomy of Swaziland
) - For sortkeys that are exactly the letter
S
(and we know that such sortkeys are found quite often), create a list of such occurrences for later manual treatment.
- If exactly
I think it's pretty safe to replace all the cases I have listed because we limit ourselves to titles that have been renamed to a name explicitly including Eswatini, so we would not affect content such as Category:Treaties extended to Swaziland (protectorate), for which Eswatini is anachronical, or Times of Swaziland, which is a proper noun. I think other namespaces (such as Template:) may be better left out for manual action.
Is there any bot master able to fulfill this request? Place Clichy (talk) 10:32, 29 May 2020 (UTC)
- Place Clichy, I made a little script to do them, they should all be fixed now. – BrandonXLF (talk) 06:49, 3 June 2020 (UTC)
- @BrandonXLF: thanks, this looks very good! Were you by any chance able to look up partial prefix matches (such as
|Swazi
), even just to build a list that I could manually take care of later? Place Clichy (talk) 08:26, 3 June 2020 (UTC)- @BrandonXLF: Do you see any reason why e.g. Category:Immigrants to Eswatini was missed? Place Clichy (talk) 00:56, 14 June 2020 (UTC)
- Place Clichy, because it's a category, I didn't have the namespace selected to search, my bad. There seems to be at least 382 categories that need fixing, see [1] and [2]. – BrandonXLF (talk) 02:48, 14 June 2020 (UTC)
- @BrandonXLF: Do you see any reason why e.g. Category:Immigrants to Eswatini was missed? Place Clichy (talk) 00:56, 14 June 2020 (UTC)
- @BrandonXLF: thanks, this looks very good! Were you by any chance able to look up partial prefix matches (such as