Template:Infobox former country/autocat

{{Documentation|content= This subtemplate of {{tl|Infobox country}} is used to automatically add categories to articles which transclude this template. It should not be used directly

Establishment dates

 * First the template tests to see if "Category:States and territories established in the " exists. If so, it is added.
 * If not, the template tests to see if "Category:States and territories established in " exists. If so, it is added.
 * If not, the template tests to see if "Category:States and territories established in the DECADEs" where DECADE is the decade containing (ie ).  If so, it is added.
 * If not, the template tests to see if "Category:States and territories established in the Nth century" where N is the century containing (ie ).  If so, it is added.

The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".

Disestablishment dates

 * First the template tests to see if "Category:States and territories disestablished in the " exists. If so, it is added.
 * If not, the template tests to see if "Category:States and territories disestablished in " exists. If so, it is added.
 * If not, the template tests to see if "Category:States and territories disestablished in the DECADEs" where DECADE is the decade containing (ie ).  If so, it is added.
 * If not, the template tests to see if "Category:States and territories disestablished in the Nth century" where N is the century containing (ie ).  If so, it is added.

The reason for the first case is in case an imprecise date is imputed, such as "the 820s" or "the 18th century", before trying exact dates like "1820".