Difference between revisions of "Template:Infobox former country/autocat"

From CWS Planet
Jump to navigation Jump to search
m
 
(13 intermediate revisions by the same user not shown)
Line 8: Line 8:
   |Upper Boroso|North Boroso|Northern Boroso = [[Category:Former countries in Upper Boroso|{{{common_name}}}, {{{year_start}}}]]
   |Upper Boroso|North Boroso|Northern Boroso = [[Category:Former countries in Upper Boroso|{{{common_name}}}, {{{year_start}}}]]
   |Lower Boroso|South Boroso|Southern Boroso = [[Category:Former countries in Lower Boroso|{{{common_name}}}, {{{year_start}}}]]
   |Lower Boroso|South Boroso|Southern Boroso = [[Category:Former countries in Lower Boroso|{{{common_name}}}, {{{year_start}}}]]
   |Šarkunen|Šarkunen Peninsula|Sharkunen|Sharkunen Peninsula = [[Category:Former countries on the Šarkunen Peninsula|{{{common_name}}}, {{{year_start}}}]]
   |Akulanen = [[Category:Former countries in Akulanen|{{{common_name}}}, {{{year_start}}}]]
   |Low Countries |Netherlands = [[Category:Former polities in the Netherlands|{{{common_name}}}, {{{year_start}}}]]
   |Puzimm |Püzimm= [[Category:Former countries in Puzimm|{{{common_name}}}, {{{year_start}}}]]
   |Japan = [[Category:Former countries in Japanese history|{{{common_name}}}, {{{year_start}}}]]
   |Low Letsatia|Letzia = [[Category:Former polities in Letzian history|{{{common_name}}}, {{{year_start}}}]]
   |Korea = [[Category:Former countries in Korean history|{{{common_name}}}, {{{year_start}}}]]
   |Vaniu|Vaniua = [[Category:Former countries in Vaniua|{{{common_name}}}, {{{year_start}}}]]
   |Malaysia = [[Category:Former countries in Malaysian history|{{{common_name}}}, {{{year_start}}}]]
   |Ekuosia|Upper Ekuosia|Lower Ekuosia = [[Category:Former countries in Ekuosia|{{{common_name}}}, {{{year_start}}}]]
   |China = [[Category:Former countries in Chinese history|{{{common_name}}}, {{{year_start}}}]]
   |Qonklaks = [[Category:Former countries in Qonklese history|{{{common_name}}}, {{{year_start}}}]]
   |Central Asia|South Asia|Southeast Asia|East Asia = [[Category:Former countries in {{{region}}}|{{{common_name}}}, {{{year_start}}}]]
   |Parshita|Milevia = [[Category:Former countries in Parshita|{{{common_name}}}, {{{year_start}}}]]
   |the Middle East|Middle East = [[Category:Former countries in the Middle East|{{{common_name}}}, {{{year_start}}}]]
  |Soltenna = [[Category:Former countries in Soltenna|{{{common_name}}}, {{{year_start}}}]]
   |East Miraria|Northern Miraria|North Miraria|Mahavia = [[Category:Former countries in Northern Miraria|{{{common_name}}}, {{{year_start}}}]]
   |#default = {{#switch:{{ucfirst:{{{country}}}}}
   |#default = {{#switch:{{ucfirst:{{{country}}}}}
    |China|Japan|Korea|Malaysia = [[Category:Former countries in {{{country}}} history|{{{common_name}}}, {{{year_start}}}]]]
     |#default = {{#switch:{{{continent}}}
     |#default = {{#switch:{{{continent}}}
       |Alpa|Baredina|Boroso|Miraria|Nagu|Shekku|Ystel = [[Category:Former countries in {{{continent}}}|{{{common_name}}}, {{{year_start}}}]]
       |Alpa|Atsiq|Baredina|Boroso|Miraria|Lahan|Nagu|Ystel = [[Category:Former countries in {{{continent}}}|{{{common_name}}}, {{{year_start}}}]]
      |Šekku = [[Category:Former countries in Shekku|{{{common_name}}}, {{{year_start}}}]]
      |Üstel = [[Category:Former countries in Ystel|{{{common_name}}}, {{{year_start}}}]]
       |#default={{!}}- style="font-size: 85%;"
       |#default={{!}}- style="font-size: 85%;"
       {{!}} colspan=2 {{!}} '''Warning''': ''Value specified for "[[Template:Infobox former country/doc#Location|continent]]" [[Template:Infobox former country/doc#Location|does not comply]]''[[Category:Former country articles requiring maintenance|C]]
       {{!}} colspan=2 {{!}} '''Warning''': ''Value specified for "[[Template:Infobox former country/doc#Location|continent]]" [[Template:Infobox former country/doc#Location|does not comply]]''[[Category:Former country articles requiring maintenance|C]]
Line 33: Line 31:
   |Confederation = [[Category:Former confederations|{{{common_name}}}]]
   |Confederation = [[Category:Former confederations|{{{common_name}}}]]
   |State union |State Union |Union = [[Category:Former state unions|{{{common_name}}}, {{{year_start}}}]]
   |State union |State Union |Union = [[Category:Former state unions|{{{common_name}}}, {{{year_start}}}]]
  |Balkist |Balkist republic = [[Category:Former Balkist republics|{{{common_name}}}, {{{year_start}}}]]
  |Kuulist |Balkist republic = [[Category:Former Kúúlist republics|{{{common_name}}}, {{{year_start}}}]]
   |Unrecognized |Unrecognised |Unrecognized state |Unrecognised state |Unrecognized State |Unrecognised State=[[Category:Former unrecognized countries|{{{common_name}}}]]
   |Unrecognized |Unrecognised |Unrecognized state |Unrecognised state |Unrecognized State |Unrecognised State=[[Category:Former unrecognized countries|{{{common_name}}}]]
   |City-state |City-State |City state |City State |City ={{#switch:{{{empire|}}}
   |City-state |City-State |City state |City State |City ={{#switch:{{{empire|}}}
Line 38: Line 38:
     |#default = [[Category:City-states|{{{common_name}}}, {{{year_start}}}]]
     |#default = [[Category:City-states|{{{common_name}}}, {{{year_start}}}]]
   }}
   }}
  |Commonwealth realm |Commonwealth Realm = [[Category:Former Commonwealth realms|{{{common_name}}}]]
   |League of Nations Mandate |League of Nations |Mandate = [[Category:League of Nations mandates|{{{common_name}}}, {{{empire}}}]]
   |League of Nations Mandate |League of Nations |Mandate = [[Category:League of Nations mandates|{{{common_name}}}, {{{empire}}}]]
   |United Nations Trust Territory| UN Trust Territory |Trust Territory=[[Category:United Nations Trust Territories|{{{common_name}}}, {{{empire}}}]]
   |Ekuosian Union Trust Territory|EkU Trust Territory |Trust Territory=[[Category:Ekuosian Union Trust Territories|{{{common_name}}}, {{{empire}}}]]
   |Protectorate = [[Category:Former {{#switch:{{{empire}}}|United Kingdom|UK|Britain=British}} protectorates|{{{common_name}}}, {{{empire}}}]]
   |Protectorate = [[Category:Former {{#switch:{{{empire}}}|United Kingdom|UK|Britain=British}} protectorates|{{{common_name}}}, {{{empire}}}]]
   |Client |Client state |Client State |Puppet |Puppet-state |Puppet state={{#switch:{{{empire|}}}
   |Client |Client state |Client State |Puppet |Puppet-state |Puppet state={{#switch:{{{empire|}}}
    |First French Empire | France = [[Category:Client states of the Napoleonic Wars|{{{common_name}}}, {{{year_start}}}]]
  |#default =  [[Category:Former client states|{{{common_name}}}, {{{year_start}}}]]
    |#default =  [[Category:Former client states|{{{common_name}}}, {{{year_start}}}]]
   }}
   }}
   |Vassal |Fief |Abbey= {{#switch:{{{empire|}}}
   |Vassal |Fief |Abbey= {{#switch:{{{empire|}}}
    |Holy Roman Empire |HRE = [[Category:States of the Holy Roman Empire|{{{common_name}}}, {{{year_start}}}]]
  |#default =  [[Category:Former vassal states|{{{common_name}}}, {{{year_start}}}]]
    |#default =  [[Category:Former vassal states|{{{common_name}}}, {{{year_start}}}]]
   }}
   }}
   |Satellite |Satellite State | Satellite state =[[Category:Soviet satellite states|{{{common_name}}}]]
   |Satellite |Satellite State | Satellite state =[[Category:Helsonian satellite states|{{{common_name}}}]]
   |Colony={{#switch:{{ucfirst:{{{empire}}}}}
   |Colony={{#switch:{{ucfirst:{{{empire}}}}}
     |United Kingdom |UK |British Empire |Britain=[[Category:Former British colonies|{{{common_name}}}, {{{empire}}}]]
     |Terminia |Terminian Empire|Terminian Three Kingdoms|Olboros Terminia=[[Category:Former Terminian colonies|{{{common_name}}}]]
    |England=[[Category:Former English colonies|{{{common_name}}}, {{{empire}}}]]
     |#default = [[Category:Former colonies|{{{common_name}}}]]
    |France |First French Empire| French Empire=[[Category:Former French colonies|{{{common_name}}}, {{{empire}}}]]
    |NL |Netherlands |The Netherlands=[[Category:Former Dutch colonies|{{{common_name}}}, {{{empire}}}]]
    |Belgium=[[Category:Former Belgian colonies|{{{common_name}}}, {{{empire}}}]]
    |Spain |Spanish Empire=[[Category:Former Spanish colonies|{{{common_name}}}, {{{empire}}}]]
    |Portugal=[[Category:Former Portuguese colonies|{{{common_name}}}, {{{empire}}}]]
    |Germany |German Empire=[[Category:Former German colonies|{{{common_name}}}, {{{empire}}}]]
    |Italy=[[Category:Former Italian colonies|{{{common_name}}}, {{{empire}}}]]
    |Sweden=[[Category:Former Swedish colonies|{{{common_name}}}, {{{empire}}}]]
    |Denmark=[[Category:Former Danish colonies|{{{common_name}}}, {{{empire}}}]]
    |Norway=[[Category:Former Norwegian colonies|{{{common_name}}}, {{{empire}}}]]
    |Japan=[[Category:Former Japanese colonies|{{{common_name}}}, {{{empire}}}]]
     |#default = [[Category:Former colonies|{{{common_name}}}, {{{empire}}}]]
   }}
   }}
   |Exile |Exiled Government = [[Category:Governments in exile|{{{common_name}}}]]
   |Exile |Exiled Government = [[Category:Governments in exile|{{{common_name}}}]]
Line 78: Line 63:
     -->|{{#ifexist:Category:States and territories established in {{{year_start}}}<!--
     -->|{{#ifexist:Category:States and territories established in {{{year_start}}}<!--
       -->|[[Category:States and territories established in {{{year_start}}}|{{{common_name}}}, {{{year_start}}}]]<!--
       -->|[[Category:States and territories established in {{{year_start}}}|{{{common_name}}}, {{{year_start}}}]]<!--
       -->|{{#ifeq:{{Str find| {{{year_start}}} |BC}}|-1<!--
       -->|{{#ifeq:{{Str find| {{{year_start}}} |BCE}}|-1<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s<!--
             -->|[[Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|[[Category:States and territories established in the {{#expr: {{{year_start}}}-{{{year_start}}}mod10}}s|{{{common_name}}}, {{{year_start}}}]]<!--
Line 86: Line 71:
                 -->}}<!--
                 -->}}<!--
             -->}}<!--
             -->}}<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod10}}s BC<!--
           -->|{{#ifexist:Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod10}}s BCE<!--
             -->|[[Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod10}}s BC|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|[[Category:States and territories established in the {{#expr: {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}-{{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod10}}s BCE|{{{common_name}}}, {{{year_start}}}]]<!--
             -->|{{#ifexist:Category:States and territories established in the {{Ordinal| {{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod100)/100+1}}}} century BC<!--
             -->|{{#ifexist:Category:States and territories established in the {{Ordinal|{{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE<!--
                 -->|[[Category:States and territories established in the {{Ordinal|{{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BC}}-1}} }}mod100)/100+1}}}} century BC|{{{common_name}}}, {{{year_start}}}]]<!--
                 -->|[[Category:States and territories established in the {{Ordinal|{{#expr: ({{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }} - {{Str mid| {{{year_start}}}||{{#expr: {{Str find|{{{year_start}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE|{{{common_name}}}, {{{year_start}}}]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y1]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y1]]<!--
                 -->}}<!--
                 -->}}<!--
Line 104: Line 89:
     -->|{{#ifexist:Category:States and territories disestablished in {{{year_end}}}<!--
     -->|{{#ifexist:Category:States and territories disestablished in {{{year_end}}}<!--
       -->|[[Category:States and territories disestablished in {{{year_end}}}|{{{common_name}}}, {{{year_end}}}]]<!--
       -->|[[Category:States and territories disestablished in {{{year_end}}}|{{{common_name}}}, {{{year_end}}}]]<!--
       -->|{{#ifeq:{{Str find| {{{year_end}}} |BC}}|-1<!--
       -->|{{#ifeq:{{Str find| {{{year_end}}} |BCE}}|-1<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{{year_end}}}-{{{year_end}}}mod10}}s|{{{common_name}}}, {{{year_end}}}]]<!--
Line 112: Line 97:
                 -->}}<!--
                 -->}}<!--
             -->}}<!--
             -->}}<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod10}}s BC<!--
           -->|{{#ifexist:Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod10}}s BCE<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod10}}s BC|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|[[Category:States and territories disestablished in the {{#expr: {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}-{{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod10}}s BCE|{{{common_name}}}, {{{year_end}}}]]<!--
             -->|{{#ifexist:Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod100)/100+1}}}} century BC<!--
             -->|{{#ifexist:Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE<!--
                 -->|[[Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BC}}-1}} }}mod100)/100+1}}}} century BC|{{{common_name}}}, {{{year_end}}}]]<!--
                 -->|[[Category:States and territories disestablished in the {{Ordinal|{{#expr: ({{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }} - {{Str mid| {{{year_end}}}||{{#expr: {{Str find|{{{year_end}}} |BCE}}-1}} }}mod100)/100+1}}}} century BCE|{{{common_name}}}, {{{year_end}}}]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y2]]<!--
                 -->|[[Category:Former country articles requiring maintenance|Y2]]<!--
                 -->}}<!--
                 -->}}<!--
Line 134: Line 119:
*First the template tests to see if "Category:States and territories established in the {{{year_start}}}" exists.  If so, it is added.
*First the template tests to see if "Category:States and territories established in the {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories established in {{{year_start}}}" 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 {{{year_start}}} (ie {{cl|States and territories established in the 120s BC}}).  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 {{{year_start}}} (ie {{cl|States and territories established in the 120s BCE}}).  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 {{{year_start}}} (ie {{cl|States and territories established in the 1st century BC}}).  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 {{{year_start}}} (ie {{cl|States and territories established in the 1st century BCE}}).  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".
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".
Line 142: Line 127:
*First the template tests to see if "Category:States and territories disestablished in the {{{year_start}}}" exists.  If so, it is added.
*First the template tests to see if "Category:States and territories disestablished in the {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in {{{year_start}}}" exists.  If so, it is added.
*If not, the template tests to see if "Category:States and territories disestablished in {{{year_start}}}" 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 {{{year_start}}} (ie {{cl|States and territories disestablished in the 120s BC}}).  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 {{{year_start}}} (ie {{cl|States and territories disestablished in the 120s BCE}}).  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 {{{year_start}}} (ie {{cl|States and territories disestablished in the 1st century BC}}).  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 {{{year_start}}} (ie {{cl|States and territories disestablished in the 1st century BCE}}).  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".
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".
}}
}}
</noinclude>
</noinclude>

Latest revision as of 16:30, 2 June 2024

Script error: The function "main" does not exist.