Template talk:Establishment category in country

Parallel disestablishments category
I'm unsure if there exists a consensus for this new hierarchy of disestablishments by country. Also, if this should be part of this template, there should be a check to see if the disestablishment category does in fact exist. If it doesn't the red link should be suppressed. __meco (talk) 20:56, 23 March 2012 (UTC)

Burma year categories
Can someone who understands the templates please go through the Burma entries in Category:Wikipedia non-empty soft redirected categories and fix them so that they reflect the country became Myanmar from 1989 onwards? The information on Template:EstcatCountry is very unhelpful for situations where the country's name changes. Timrollpickering (talk) 09:05, 23 August 2015 (UTC)
 * ✅. I added new parameters to 4 templates for the new name of a country. – Fayenatic  L ondon 07:58, 6 September 2015 (UTC)

Parameter for new name
Please list here any countries where the "new name" parameter has been used in estcatCountry, EstcatCountryDecade, EstcatCountryCentury or disestcatCountry, as I added this without discussion, and it may be desirable to change the way it works.


 * Burma / Myanmar – Fayenatic  L ondon 08:10, 6 September 2015 (UTC)
 * However, EstcatCountryDecade is no longer used for C20; Template:Myanmar C20 estab by decade is now used instead. – Fayenatic  L ondon 23:57, 18 September 2015 (UTC)


 * Category:Establishments in Curaçao and Dependencies by decade / year was merged into Category:Establishments in the Netherlands Antilles by decade / year.
 * Likewise, Siam to Thailand. 12:51, 23 March 2016 (UTC)


 * Malaya / Federation of Malaya / Malayan Union —ADavidB 05:23, 6 March 2017 (UTC)
 * / US Virgin Islands. – Fayenatic  L ondon 22:37, 13 February 2019 (UTC)

Places where it was not useful:
 * Spanish Sahara: e.g. the parents of Category:1970s establishments in Spanish Sahara are the other way round from those enabled in this template, viz. 20th-century establishments in Western Sahara, Establishments in Spanish Sahara by decade. – Fayenatic  L ondon 22:04, 29 December 2015 (UTC)


 * Austrian Netherlands: e.g. Category:1720s disestablishments in the Austrian Netherlands is in Category:18th-century disestablishments in the Southern Netherlands but Category:Disestablishments in Belgium by decade. For the template to cope with such varied hierarchies would call for named parameters rather than relying on numbered parameters. – Fayenatic  L ondon 11:23, 8 May 2019 (UTC)

Places that need it:


 * Category:1922 establishments in Turkey - Category:1922 in Turkey redirects to Category:1922 in the Ottoman Empire and attempts to manually override the template have failed. Timrollpickering (talk) 15:56, 30 September 2016 (UTC)
 * Apologies for the delay in responding. Would it be appropriate to have Ottoman Empire categories up to and including 1922, and Turkey only from 1923, avoiding the current overlap? – Fayenatic  L ondon 15:03, 17 April 2018 (UTC)
 * I think an overlap is fine but it's usually best implemented manually. Timrollpickering 19:36, 17 April 2018 (UTC)

As of August 2019, thanks to user:BrownHairedGirl, pages that use this parameter are in Category:EstcatCountry with newname parameter. – Fayenatic  L ondon 03:39, 30 August 2019 (UTC)
 * Category
 * Thanks, Fayenatic. The edit was only two days ago, the category is probably still fillig up. --  Brown HairedGirl  (talk) • (contribs) 04:06, 30 August 2019 (UTC)
 * I've tweaked it to sort by country rather than by year. Trust that's not detrimental for your purposes. – Fayenatic  L ondon 04:35, 30 August 2019 (UTC)

For the record, the above section is now obsolete, see section below. Further category redirects may need to be set up in other cases. To avoid deletion of such redirect pages, they should be tagged with R from category navigation. – Fayenatic  L ondon 14:13, 28 January 2022 (UTC)

2010 •2011 error
Replace Line 3 as. Then 2010 •2011 will be changed into 2010 • 2011. Sawol (talk) 06:14, 18 August 2018 (UTC)
 * Yes check.svg Done Looks fine to me either way. Please verify that it looks fixed now to you, . Enterprisey (talk!) 07:48, 18 August 2018 (UTC)

Sort key parameter for Template:Estcatsubcountry and Template:Disestcatsubcountry

 * The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Could a template expert please add sort key parameters to Template:Estcatsubcountry and Template:Disestcatsubcountry? At the moment I am having to use a work around for subdivisions which we normally prefix with "the" (e.g. the Valencian Community - see Category:2019 establishments in the Valencian Community and Category:2019 disestablishments in the Valencian Community). Thanks.--Obi2canibe (talk) 13:45, 30 June 2019 (UTC)


 * The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Typo in documentation
BrownHairedGirl, there appears to be a typo in the Burma example in the documentation (diff), but I'm not sure whether it's a missing pipe or a repeated parameter. --Paul_012 (talk) 20:32, 16 June 2021 (UTC)
 * Thanks, . Now fixed. --  Brown HairedGirl  (talk) • (contribs) 16:48, 17 June 2021 (UTC)

Resolve category redirect
If this template would resolve a category redirect on the decade parent, it could replace several tailored templates that bridge the dates of name changes, see Templates for discussion/Log/2022 January 13.

What's more, resolving category redirects on the "by year" category could probably also be used to make the third parameter (new name) obsolete. – Fayenatic  L ondon 09:15, 14 January 2022 (UTC)
 * I have now incorporated Resolve category redirect to fix the decade parent and the "estab in [country] by year" parent categories. This is working on e.g. Category:1980 establishments in Burma and Category:1991 establishments in the Republic of Macedonia. – Fayenatic  L ondon 22:57, 20 January 2022 (UTC)


 * However something's causing a mess at Category:1964 establishments in Northern Rhodesia which is populating Category:1964 in Northern Rhodesia. Timrollpickering (talk) 12:46, 21 January 2022 (UTC)
 * Thanks, it seems that Category:1964 establishments in Northern Rhodesia was used intentionally rather than Category:1964 establishments in Zambia which is also in use, so I subst'd and trimmed the template on that page, in order to change the parent category to . But it is rare a case where having categories for both names in one year might be justified. – Fayenatic  L ondon 18:02, 22 January 2022 (UTC)
 * I realised that this just needed one more resolve category redirect and have now implemented this, which also resolves the 1922 Turkey example that you highlighted in an earlier section above. – Fayenatic  L ondon 22:19, 27 January 2022 (UTC)


 * the 5th parameter for newname is now obsolete. May I remove the newname code from the templates, and delete the tracking categories Category:EstcatCountry with newname parameter & its "dis" sibling? – Fayenatic  L ondon 17:18, 27 January 2022 (UTC)
 * @Fayenatic london: the honest answer is that I dunno.
 * There is a lot of complexity across this whole template and its subpages which was added to cope with various variations, of which name changes are just one part. As I have said before, the whole thing needs a major rewrite to accommodate new coding techniques (of which Resolve category redirect is only one part) ... and in the meantime I don't want to put a lot of effort into re-evaluating a large chunk of old code.
 * This is top of my list for when I finish my work on bare URL refs. I hope that if WP:Bots/Requests for approval/BareRefBot is approved, I can massively scale back that work and get back to templating.  But until then, I cant't make a  judgement without putting in more time than I can spare.   Brown HairedGirl  (talk) • (contribs) 17:35, 27 January 2022 (UTC)
 * Thanks. In this case I found the coding straightforward, so I had the confidence to remove the obsolete code myself, and update the documentation to match. (Would be happy to be reverted or be asked sort out any unforeseen consequences if such a need arises.) – Fayenatic  L ondon 21:47, 27 January 2022 (UTC)
 * Thanks, @Fayenatic london.  Sorry I can't be more help.   Brown HairedGirl  (talk) • (contribs) 22:21, 27 January 2022 (UTC)
 * For the record, I have made corresponding updates to Template:EstcatCountryDecade. However, Template:DisestcatCountryDecade still takes the old format including numerical parameters. – Fayenatic  L ondon 22:46, 28 January 2022 (UTC)

Generating parents for continent etc
Manual coding of parents for continents, regions, federations, empires etc is patchy.

Would it be good to generate these from the template? One possibility would be to add (up to 4?) parameters for such, and generate the parent categories in this template.

The sort key could be parameter 2 if used, otherwise parameter 1. However, that would miss subtleties such as "Category:2015 establishments in the Republic of Macedonia" which is sorted by "Macedonia" rather than "Republic" in such parents; one workaround would be to retain the existing manually coded parents in such cases.

But none of the above would solve the problem of patchy implementation. An alternative approach would be to use a lookup table to generate such parents from the country name, similar to an existing parsing table that generates links to portals. This would require use of start and end dates for empires etc. I think this may be on BrownHairedGirl's long-term radar already. – Fayenatic  L ondon 17:27, 27 January 2022 (UTC)


 * @Fayenatic london: this is on my radar for the rewrite.  Brown HairedGirl  (talk) • (contribs) 17:36, 27 January 2022 (UTC)
 * great. For reference, I found 5 such parents at Category:1950s establishments in French Sudan – that's the most so far. – Fayenatic  L ondon 15:13, 30 January 2022 (UTC)
 * I've added parent categories for continents. Template:Establishment category in country/core/sandbox. It only adds them if the category exists. Mason (talk) 13:37, 27 March 2024 (UTC)

Duplicate portals
This template is showing the Geography portal twice on Category:1944 establishments in Armenia, is there a way to de-duplicate it? Thanks. --Jameboy (talk) 10:18, 6 February 2023 (UTC)
 * Done. It now says Asia and Europe. – Fayenatic  L ondon 08:26, 7 February 2023 (UTC)
 * I have followed this up for a couple of dozen other countries whose portals have been deleted. is a search to check where else the country name is generating the repeated geography portal. Although it currently shows some 2,000 results, these should all disappear as the cached versions of pages get updated.
 * I have also documented at Template:YearInCountryPortalBox how that feature works. – Fayenatic  L ondon 21:58, 7 February 2023 (UTC)
 * Now they are all resolved except for one about Golan Heights, which may be deleted per Categories for discussion/Log/2023 February 7. – Fayenatic  L ondon 09:44, 8 February 2023 (UTC)