跳转到内容

模組:Place/shared-data

維基詞典,自由的多語言詞典
local export = {}
--[=[
This module contains data shared between [[Module:place/data]] and [[Module:category tree/topic cat/data/Places]].
You must load this module using require(), not using mw.loadData().
]=]

local m_table = require("Module:table")
local topic_cat_utilities_module = "Module:category tree/topic cat/utilities"

-----------------------------------------------------------------------------------
--                              Placetype Tables                                 --
-----------------------------------------------------------------------------------

-- Recognized political and misc. subdivisions. The key is the plural
-- subdivision and the value is the equivalent description, with links.
export.political_subdivisions = {
	["administrative atolls"] = "[[administrative]] [[atoll]]s",
	["areas"] = "[[area]]s",
	["arrondissements"] = "[[arrondissement]]s",
	["atolls"] = "[[atoll]]s",
	["autonomous communities"] = "[[w:autonomous communities|autonomous communities]]",
	["autonomous islands"] = "[[autonomous]] [[island]]s",
	["autonomous oblasts"] = "[[autonomous oblast]]s",
	["autonomous okrugs"] = "[[autonomous okrug]]s",
	["autonomous regions"] = "[[autonomous]] [[region]]s",
	["自治區"] = "[[自治區]]",
	["autonomous republics"] = "[[w:autonomous republic|autonomous republic]]s",
	["boroughs"] = "[[borough]]s",
	["borough seats"] = "[[borough seat]]s",
	["cantons"] = "[[canton]]s",
	["census divisions"] = "[[w:census division|census division]]s",
	["cercles"] = "[[cercle]]s",
	["civil parishes"] = "[[civil parish]]es",
	["collectivities"] = "[[collectivity|collectivities]]",
	["constituencies"] = "[[constituency|constituencies]]",
	["constituent countries"] = "[[constituent]] [[country|countries]]",
	["council areas"] = "[[council area]]s",
	["counties"] = "[[county|counties]]",
	["縣"] = "[[縣]]",
	["county boroughs"] = "[[county borough]]s",
	["county seats"] = "[[county seat]]s",
	["countries"] = "[[country|countries]]",
	["delegations"] = "[[delegation]]s",
	["departments"] = "[[department]]s",
	["dependencies"] = "[[dependency|dependencies]]",
	["districts"] = "[[district]]s",
	["區"] = "[[區]]",
	["districts and autonomous regions"] = "[[district]]s and [[autonomous region]]s",
	["divisions"] = "[[division]]s",
	["emirates"] = "[[emirate]]s",
	["entities"] = "[[entity|entities]]",
	["ethnographic regions"] = "[[ethnographic]] [[region]]s",
	["federal cities"] = "[[federal]] [[city|cities]]",
	["federal territories"] = "[[federal]] [[territory|territories]]",
	["gewogs"] = "[[gewog]]s",
	["governorates"] = "[[governorate]]s",
	["krais"] = "[[krai]]s",
	["local councils"] = "[[w:local council|local council]]s",
	["local government areas"] = "[[w:local government area|local government area]]s",
	["metropolitan cities"] = "[[metropolitan city|metropolitan cities]]",
	["mukims"] = "[[mukim]]s",
	["municipal districts"] = "[[w:municipal district|municipal district]]s",
	["municipalities"] = "[[municipality|municipalities]]",
	["直轄市"] = "[[直轄市]]",
	["市鎮"] = "[[市鎮]]",
	["oblasts"] = "[[oblast]]s",
	["parishes"] = "[[parish]]es",
	["parish seats"] = "[[parish seat]]s",
	["prefectures"] = "[[prefecture]]s",
	["州"] = "[[州]]",
	["都道府縣"] = "[[都道府縣]]",
	["provinces"] = "[[省]]",
	["省"] = "[[省]]",
	["quarters"] = "[[quarter]]s",
	["raions"] = "[[raion]]s",
	["regencies"] = "[[regency|regencies]]",
	["regional county municipalities"] = "[[w:regional county municipality|regional county municipalities]]",
	["regional districts"] = "[[w:regional district|regional district]]s",
	["regional municipalities"] = "[[w:regional municipality|regional municipalities]]",
	["regions"] = "[[region]]s",
	["地區"] = "[[地區]]",
	["regional units"] = "[[regional unit]]s",
	["republics"] = "[[republic]]s",
	["rural municipalities"] = "[[w:rural municipality|rural municipalities]]",
	["self-administered divisions"] = "[[w:self-administered division|self-administered division]]s",
	["self-administered zones"] = "[[w:self-administered zone|self-administered zone]]s",
	["special administrative regions"] = "[[w:Special administrative regions of China|special administrative regions]]",
	["特別行政區"] = "[[w:特别行政区|特別行政區]]",
	["special wards"] = "[[special ward]]s",
	["states"] = "[[state]]s",
	["subprefectures"] = "[[subprefecture]]s",
	["subregions"] = "[[subregion]]s",
	["territorial authorities"] = "[[w:territorial authority|territorial authorities]]",
	["territories"] = "[[territory|territories]]",
	["traditional counties"] = "[[w:traditional county|traditional counties]]",
	["unincorporated areas"] = "[[w:unincorporated area|unincorporated area]]s",
	["union territories"] = "[[union territory|union territories]]",
	["voivodeships"] = "[[voivodeship]]s",
	["zones"] = "[[zone]]s",
}

-- Place types for which categories can be constructed for all the places listed
-- below other than cities. The key should be the plural place type and the value
-- should be the description.
export.generic_place_types = {
	["cities"] = "cities",
	["ghost towns"] = "[[ghost town]]s",
	["towns"] = "towns",
	["communes"] = "[[commune]]s",
	["villages"] = "villages, hamlets, and other small communities and settlements",
	["neighborhoods"] = "[[neighborhood]]s, [[district]]s and other subportions of cities",
	["neighbourhoods"] = "[[neighbourhood]]s, [[district]]s and other subportions of cities",
	["suburbs"] = "[[suburb]]s",
	["rivers"] = "rivers",
	["census-designated places"] = "[[census-designated place]]s",
	["unincorporated communities"] = "[[w:unincorporated community|unincorporated communities]]",
	["places"] = "各種地方",
	["地名"] = "各種地方",
}

-- Place types for which categories can be constructed for cities listed below.
-- The key should be the plural place type and the value should be the description.
export.generic_place_types_for_cities = {
	["neighborhoods"] = "[[neighborhood]]s, [[district]]s and other subportions of cities",
	["neighbourhoods"] = "[[neighbourhood]]s, [[district]]s and other subportions of cities",
	["suburbs"] = "[[suburb]]s",
	["places"] = "各種地方",
	["地名"] = "各種地方",
}

export.placetype_to_capital_cat = {
	["autonomous community"] = "autonomous community capitals",
	["canton"] = "cantonal capitals",
	["country"] = "national capitals",
	["department"] = "departmental capitals",
	["district"] = "district capitals",
	["emirate"] = "emirate capitals",
	["prefecture"] = "prefectural capitals",
	["province"] = "provincial capitals",
	["region"] = "regional capitals",
	["republic"] = "republic capitals",
	["state"] = "state capitals",
	["territory"] = "territorial capitals",
	["voivodeship"] = "voivodeship capitals",
}

export.capital_cat_to_placetype = {}
for placetype, capital_cat in pairs(export.placetype_to_capital_cat) do
	export.capital_cat_to_placetype[capital_cat] = placetype
end

-----------------------------------------------------------------------------------
--                              Placename Tables                                 --
-----------------------------------------------------------------------------------

--[=[

Each of the following tables specifies a group of polities with common properties (e.g. the
states of the US). Each table is associated with a polity "group" (an entry in 'export.polities'),
which contains handlers specifying how to process the data tables and also a pointer to the
relevant table. The data is used as follows:

1. To generate the text of topical categories for cities/towns/rivers/etc. in a given polity,
   e.g. 'fr:Cities in Alabama, USA' for French terms for cities in Alabama. Note that each
   such category (this in fact applies to all topical categories) has a parent category such as
   'Cities in Alabama, USA' that groups all language-specific topic categories together.
2. To generate the text of topical categories for political subdivisions of a given polity,
   e.g. 'de:Provinces of the Netherlands', 'es:Counties of Alabama', or
   'pt:Municipalities of Amazonas, Brazil'.
3. To generate the text of a "bare label" topical category directly associated with the polity,
   such as 'de:Netherlands', 'es:Alabama, USA', or 'pt:Amazonas, Brazil'.
4. To add pages to all the above types of categories when a call to {{place}} on that page
   references the polity, such as by a template call {{place|en|city|state/Alabama}} (which will
   add the page to 'en:Cities in Alabama, USA'.

Uses #1, #2 and #3 are controlled by [[Module:category tree/topic cat/data/Places]].
Use #4 is controlled by [[Module:place/data]].

The keys of each table are the polity names in the form they will appear in a category like
'de:Provinces of the Netherlands' or 'fr:Cities in Alabama, USA' (hence, they should include
prefixes such as "the" and suffixes such as ", USA"). Transforming these keys to the form that
appears in the bare label category (e.g. 'de:Netherlands'), in category parents and/or in
descriptions can be done using the 'bare_label_setter' and 'value_transformer' keys (see
'export.polities' below).
	 
The value of an item in each table is itself a table. This table contains properties describing
the polity in question. Note that before being used (e.g. to generate the contents of a category
page like '[[:Category:en:Cities in Ireland]]' or '[[:Category:de:Provinces of the Netherlands]]'
of to specify how to add the relevant categories to a page with a call to {{place}})', the table
is passed through the associated polity group's 'value_transformer' function (see 'export.polities').
That function generally augments the property table with additional properties that are common to
the group or derivable from group-specific properties. The following are the properties most
commonly specified (additional properties are sometimes attached to entries in specific groups):

- 'divtype': String specifying the type of polity or subpolity (e.g. "country", "state", province").
  This can also be a table of such types; in this case, the first listed type is the canonical type
  that will be used in descriptions, but the polity will be recognized (e.g. in {{place}} arguments)
  when tagged with any of the specified types. This value overrides the group-level 'default_divtype'
  value, and only needs to be specified if it disagrees with that value.

- 'poldiv': List of recognized political subdivisions; e.g. for the Netherlands, a specification of
  the form 'poldiv = {"provinces", "municipalities"}' will allow categories such as 'de:Provinces of
  the Netherlands' and 'pt:Municipalities of the Netherlands' to be created. These categories have a
  primary parent "Political subdivisions" (i.e. this is the parent that appears in the breadcrumbs at
  the top of the category page), and have the containing polity, if any (see 'containing_polity' below)
  as an additional parent. Any political subdivision that appears here must also be listed in the
  'political_subdivisions' list, which tells how to convert the pluralized political subdivision into
  the equivalent linked description. (If not listed, an error occurs.)

- 'miscdiv': List of recognized historical/popular subdivisions; e.g. for Ireland, a specification of
  the form 'miscdiv = {"provinces"}' will allow categories such as 'pl:Provinces of Ireland' to be
  created. These categories differ from political subdivision categories in that their primary parent
  is the country name rather than "Political subdivisions".

- 'is_city': If 'true', don't recognize or generate categories such as 'en:Cities in Monaco'
  (specifically, for place types in generic_place_types but not in generic_place_types_for_cities).

- 'is_former_place': If 'true', don't recognize or generate categories such as 'fr:Rivers in the Soviet Union'
  (specifically, for any place type in generic_place_types other than "places").
  NOTE: This key may be added automatically by the 'value_transformer' function.
  
- 'keydesc': String directly specifying a description of the polity, for use in generating the contents
  of category pages related to the polity. descriptions. This property is only rarely present, and is
  normally generated automatically by the 'value_transformer' function from the key and (for subpolities)
  the value of 'divtype'.

- 'parents': List of parents of the bare label category. For example, if 'parents = {"歐洲", "亞洲"}'
  is specified for "Turkey", bare label categories such as 'en:Turkey' will have parent categories
  'en:Europe' and 'en:Asia'. The first listed category is used for the primary parent (i.e. this is the
  parent that appears in the breadcrumbs at the top of the category page). In this case, for example,
  "歐洲" (not "亞洲") is used as the breadcrumb. This property only needs to be specified for
  top-level polities (countries and such), not for subpolities (states, provinces, etc.), which use the
  value of 'containing_polity' (see below) as the parent.

- 'bare_label_desc': String specifying the description used in the bare label category. If not given, a
   default description is constructed by the 'bare_label_setter' function.

- 'containing_polity': This property does not need to be specified explicitly. It is automatically added
  by the 'value_transformer' function for subpolities, and left off for top-level polities. It specifies
  the larger polity in which the subpolity is contained, and is used to construct the primary parent of
  'Cities in ...', 'Rivers in ...', and similar categories. For example, the subpolity Guangdong (a province
  of China) will have "中國" as the containing_polity, so that a category of the form
  'en:Cities in Guangdong" will have its primary parent (i.e. the parent that appears in the breadcrumbs at
  the top of the category page) as "Cities in China". If containing_polity is omitted, as in top-level
  polities, the primary parent will simply be "Cities" (or "Towns", "Rivers", etc. as appropriate).
]=]

export.countries = {
	["阿富汗"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}, miscdiv = {"regions"}},
	["阿爾巴尼亞"] = {parents = {"歐洲"}, poldiv = {"counties", "municipalities"}, british_spelling = true},
	["阿爾及利亞"] = {parents = {"非洲"}, poldiv = {"provinces", "communes", "districts", "municipalities"}},
	["安道爾"] = {parents = {"歐洲"}, poldiv = {"parishes"}, british_spelling = true},
	["安哥拉"] = {parents = {"非洲"}, poldiv = {"provinces", "municipalities"}},
	["安提瓜和巴布達"] = {parents = {"北美洲"}, poldiv = {"provinces"}, british_spelling = true},
	["阿根廷"] = {parents = {"南美洲"}, poldiv = {"provinces", "departments", "municipalities"}},
	["亞美尼亞"] = {parents = {"歐洲", "亞洲"}, poldiv = {"regions", "provinces"}, british_spelling = true},
	-- Both a country and continent
	["澳大利亞"] = {parents = {"地球", "大洋洲"}, poldiv = {"states", "territories", "local government areas"}, british_spelling = true},
	["奧地利"] = {parents = {"歐洲"}, poldiv = {"states", "districts", "municipalities"}, british_spelling = true},
	["阿塞拜疆"] = {parents = {"歐洲", "亞洲"}, poldiv = {"districts", "municipalities"}, british_spelling = true},
	["巴哈馬"] = {parents = {"北美洲"}, poldiv = {"districts"}, british_spelling = true},
	["巴林"] = {parents = {"亞洲"}, poldiv = {"governorates"}},
	["孟加拉"] = {parents = {"亞洲"}, poldiv = {"divisions", "districts", "municipalities"}, british_spelling = true},
	["巴巴多斯"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["白俄羅斯"] = {parents = {"歐洲"}, poldiv = {"regions", "districts"}, british_spelling = true},
	["比利時"] = {parents = {"歐洲"}, poldiv = {"regions", "provinces", "municipalities"}, british_spelling = true},
	["伯利茲"] = {parents = {"中美洲"}, poldiv = {"districts"}, british_spelling = true},
	["貝寧"] = {parents = {"非洲"}, poldiv = {"departments", "communes"}},
	["不丹"] = {parents = {"亞洲"}, poldiv = {"districts", "gewogs"}},
	["玻利維亞"] = {parents = {"南美洲"}, poldiv = {"provinces", "departments", "municipalities"}},
	["波斯尼亞和黑塞哥維那"] = {parents = {"歐洲"}, poldiv = {"entities", "cantons", "municipalities"}, british_spelling = true},
	["博茨瓦納"] = {parents = {"非洲"}, poldiv = {"districts", "subdistricts"}, british_spelling = true},
	["巴西"] = {parents = {"南美洲"}, poldiv = {"states", "municipalities"}, miscdiv = {"regions"}},
	["汶萊"] = {parents = {"亞洲"}, poldiv = {"districts", "mukims"}, british_spelling = true},
	["保加利亞"] = {parents = {"歐洲"}, poldiv = {"provinces", "municipalities"}, british_spelling = true},
	["布基納法索"] = {parents = {"非洲"}, poldiv = {"regions", "departments", "provinces"}},
	["緬甸"] = {parents = {"亞洲"}, poldiv = {"regions", "states", "union territories", "self-administered zones", "self-administered divisions", "districts"}},
	["布隆迪"] = {parents = {"非洲"}, poldiv = {"provinces", "communes"}},
	["柬埔寨"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}},
	["喀麥隆"] = {parents = {"非洲"}, poldiv = {"regions", "departments"}},
	["加拿大"] = {parents = {"北美洲"}, poldiv = {"provinces", "territories", "counties", "districts", "municipalities"},
		miscdiv = {"regions", "census divisions"}, british_spelling = true},
	["佛得角"] = {parents = {"非洲"}, poldiv = {"municipalities", "parishes"}},
	["中非共和國"] = {parents = {"非洲"}, poldiv = {"prefectures", "subprefectures"}},
	["乍得"] = {parents = {"非洲"}, poldiv = {"regions", "departments"}},
	["智利"] = {parents = {"南美洲"}, poldiv = {"regions", "provinces"}},
	["中國"] = {parents = {"亞洲"}, poldiv = {"省", "自治區",
		"特別行政區", "州", "縣", "區", "直轄市"},
		miscdiv = {"地區"}},
	["哥倫比亞"] = {parents = {"南美洲"}, poldiv = {"departments", "municipalities"}},
	["葛摩"] = {parents = {"非洲"}, poldiv = {"autonomous islands"}},
	["哥斯達黎加"] = {parents = {"中美洲"}, poldiv = {"provinces", "cantons"}},
	["克羅地亞"] = {parents = {"歐洲"}, poldiv = {"counties", "municipalities"}, british_spelling = true},
	["古巴"] = {parents = {"北美洲"}, poldiv = {"provinces", "municipalities"}},
	["塞浦路斯"] = {parents = {"歐洲", "亞洲"}, poldiv = {"districts"}, british_spelling = true},
	["捷克"] = {parents = {"歐洲"}, poldiv = {"regions", "districts"}, british_spelling = true},
	["剛果民主共和國"] = {parents = {"非洲"}, poldiv = {"provinces", "territories"}},
	["丹麥"] = {parents = {"歐洲"}, poldiv = {"regions", "municipalities", "territories"}, british_spelling = true},
	["吉布提"] = {parents = {"非洲"}, poldiv = {"regions", "districts"}},
	["多米尼克"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["多米尼加"] = {parents = {"北美洲"}, poldiv = {"provinces", "municipalities"},
		keydesc = "the [[Dominican Republic]], the country that shares the [[加勒比地區]] island of [[伊斯帕尼奧拉島]] with [[海地]]"},
	["東帝汶"] = {parents = {"亞洲"}, poldiv = {"municipalities"}},
	["厄瓜多爾"] = {parents = {"南美洲"}, poldiv = {"provinces", "cantons"}},
	["埃及"] = {parents = {"非洲"}, poldiv = {"governorates", "regions"}},
	["薩爾瓦多"] = {parents = {"中美洲"}, poldiv = {"departments", "municipalities"}},
	["赤道幾內亞"] = {parents = {"非洲"}, poldiv = {"provinces"}},
	["厄立特里亞"] = {parents = {"非洲"}, poldiv = {"regions", "subregions"}},
	["愛沙尼亞"] = {parents = {"歐洲"}, poldiv = {"counties", "municipalities"}, british_spelling = true},
	["衣索比亞"] = {parents = {"非洲"}, poldiv = {"regions", "zones"}},
	["密克羅尼西亞聯邦"] = {parents = {"密克羅尼西亞"}, poldiv = {"states"}},
	["斐濟"] = {parents = {"美拉尼西亞"}, poldiv = {"divisions", "provinces"}, british_spelling = true},
	["芬蘭"] = {parents = {"歐洲"}, poldiv = {"regions", "municipalities"}, british_spelling = true},
	["法國"] = {parents = {"歐洲"}, poldiv = {"regions", "departments", "collectivities", "municipalities",
		"territories"}, miscdiv = {"provinces"}, british_spelling = true},
	["加蓬"] = {parents = {"非洲"}, poldiv = {"provinces", "departments"}},
	["甘比亞"] = {parents = {"非洲"}, poldiv = {"divisions", "districts"}, british_spelling = true},
	["格魯吉亞"] = {parents = {"歐洲", "亞洲"}, poldiv = {"regions", "districts"}, keydesc = "the country of [[格魯吉亞]], in [[歐亞大陸]]", british_spelling = true},
	["德國"] = {parents = {"歐洲"}, poldiv = {"states", "municipalities", "districts"}, british_spelling = true},
	["加納"] = {parents = {"非洲"}, poldiv = {"regions", "districts"}, british_spelling = true},
	["希臘"] = {parents = {"歐洲"}, poldiv = {"regional units", "municipalities"}, british_spelling = true},
	["格瑞那達"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["危地馬拉"] = {parents = {"中美洲"}, poldiv = {"departments", "municipalities"}},
	["幾內亞"] = {parents = {"非洲"}, poldiv = {"regions", "prefectures"}},
	["幾內亞比紹"] = {parents = {"非洲"}, poldiv = {"regions"}},
	["蓋亞那"] = {parents = {"南美洲"}, poldiv = {"regions"}, british_spelling = true},
	["海地"] = {parents = {"北美洲"}, poldiv = {"departments", "arrondissements"}},
	["洪都拉斯"] = {parents = {"中美洲"}, poldiv = {"departments", "municipalities"}},
	["匈牙利"] = {parents = {"歐洲"}, poldiv = {"counties", "districts"}, british_spelling = true},
	["冰島"] = {parents = {"歐洲"}, poldiv = {"regions", "municipalities", "counties"}, british_spelling = true},
	["印度"] = {parents = {"亞洲"}, poldiv = {"states", "union territories", "divisions", "districts", "municipalities"}, british_spelling = true},
	["印度尼西亞"] = {parents = {"亞洲"}, poldiv = {"regencies", "provinces"}},
	["伊朗"] = {parents = {"亞洲"}, poldiv = {"provinces", "counties"}},
	["伊拉克"] = {parents = {"亞洲"}, poldiv = {"governorates", "districts"}},
	["愛爾蘭"] = {parents = {"歐洲", "不列顛群島"}, poldiv = {"counties", "districts"}, miscdiv = {"provinces"}, british_spelling = true},
	["以色列"] = {parents = {"亞洲"}, poldiv = {"districts"}},
	["意大利"] = {parents = {"歐洲"}, poldiv = {"regions", "provinces", "metropolitan cities"}, miscdiv = {"regions"}, british_spelling = true},
	["科特迪瓦"] = {parents = {"非洲"}, poldiv = {"districts", "regions"}},
	["牙買加"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["日本"] = {parents = {"亞洲"}, poldiv = {"都道府縣", "區部", "市町村"}},
	["約旦"] = {parents = {"亞洲"}, poldiv = {"governorates"}},
	["哈薩克斯坦"] = {parents = {"亞洲", "歐洲"}, poldiv = {"regions", "districts"}},
	["肯尼亞"] = {parents = {"非洲"}, poldiv = {"counties"}, british_spelling = true},
	["基里巴斯"] = {parents = {"密克羅尼西亞"}, british_spelling = true},
	["科索沃"] = {parents = {"歐洲"}, british_spelling = true},
	["科威特"] = {parents = {"亞洲"}, poldiv = {"governorates", "areas"}},
	["吉爾吉斯斯坦"] = {parents = {"亞洲"}, poldiv = {"regions", "districts"}},
	["老撾"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}},
	["拉脫維亞"] = {parents = {"歐洲"}, poldiv = {"municipalities"}, miscdiv = {"regions"}, british_spelling = true},
	["黎巴嫩"] = {parents = {"亞洲"}, poldiv = {"governorates", "districts"}},
	["萊索托"] = {parents = {"非洲"}, poldiv = {"districts"}, british_spelling = true},
	["利比里亞"] = {parents = {"非洲"}, poldiv = {"counties", "districts"}},
	["利比亞"] = {parents = {"非洲"}, poldiv = {"districts", "municipalities"}},
	["列支敦斯登"] = {parents = {"歐洲"}, poldiv = {"municipalities"}, british_spelling = true},
	["立陶宛"] = {parents = {"歐洲"}, poldiv = {"counties", "municipalities"},
		miscdiv = {"ethnographic regions"}, british_spelling = true},
	["盧森堡"] = {parents = {"歐洲"}, poldiv = {"cantons"}, miscdiv = {"districts"}, british_spelling = true},
	["馬達加斯加"] = {parents = {"非洲"}, poldiv = {"regions", "districts"}},
	["馬拉維"] = {parents = {"非洲"}, poldiv = {"regions", "districts"}, british_spelling = true},
	["馬來西亞"] = {parents = {"亞洲"}, poldiv = {"states", "federal territories", "districts"}, british_spelling = true},
	["馬爾代夫"] = {parents = {"亞洲"}, poldiv = {"provinces", "administrative atolls"}, british_spelling = true},
	["馬里"] = {parents = {"非洲"}, poldiv = {"regions", "cercles"}},
	["馬耳他"] = {parents = {"歐洲"}, poldiv = {"regions", "local councils"}, british_spelling = true},
	["馬紹爾群島"] = {parents = {"密克羅尼西亞"}, poldiv = {"municipalities"}},
	["毛里塔尼亞"] = {parents = {"非洲"}, poldiv = {"regions", "departments"}},
	["毛里求斯"] = {parents = {"非洲"}, poldiv = {"districts"}, british_spelling = true},
	["墨西哥"] = {parents = {"北美洲", "中美洲"}, poldiv = {"states", "municipalities"}},
	["摩爾多瓦"] = {parents = {"歐洲"}, poldiv = {"districts", "municipalities"}, british_spelling = true},
	["摩納哥"] = {parents = {"歐洲"}, is_city = true, british_spelling = true},
	["蒙古"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}},
	["黑山"] = {parents = {"歐洲"}, poldiv = {"municipalities"}},
	["摩洛哥"] = {parents = {"非洲"}, poldiv = {"regions", "prefectures", "provinces"}},
	["莫桑比克"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}},
	["納米比亞"] = {parents = {"非洲"}, poldiv = {"regions", "constituencies"}, british_spelling = true},
	["瑙魯"] = {parents = {"密克羅尼西亞"}, poldiv = {"districts"}, british_spelling = true},
	["尼泊爾"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}},
	["荷蘭"] = {parents = {"歐洲"}, poldiv = {"provinces", "municipalities"}, british_spelling = true},
	["新西蘭"] = {parents = {"玻里尼西亞"}, poldiv = {"regions", "territorial authorities"}, british_spelling = true},
	["尼加拉瓜"] = {parents = {"中美洲"}, poldiv = {"departments", "municipalities"}},
	["尼日爾"] = {parents = {"非洲"}, poldiv = {"regions", "departments"}},
	["尼日利亞"] = {parents = {"非洲"}, poldiv = {"states", "local government areas"}, british_spelling = true},
	["朝鮮"] = {parents = {"亞洲", "朝鮮半島"}, poldiv = {"provinces", "counties"}},
	["北馬其頓"] = {parents = {"歐洲"}, poldiv = {"municipalities"}, british_spelling = true},
	["挪威"] = {parents = {"歐洲"}, poldiv = {"counties", "municipalities", "dependencies"},
		miscdiv = {"districts", "unincorporated areas"}, british_spelling = true},
	["阿曼"] = {parents = {"亞洲"}, poldiv = {"governorates", "provinces"}},
	["巴基斯坦"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["巴勒斯坦"] = {parents = {"亞洲"}},
	["帕勞"] = {parents = {"密克羅尼西亞"}, poldiv = {"states"}},
	["巴拿馬"] = {parents = {"中美洲"}, poldiv = {"provinces", "districts"}},
	["巴布亞新幾內亞"] = {parents = {"美拉尼西亞"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["巴拉圭"] = {parents = {"南美洲"}, poldiv = {"departments", "districts"}},
	["秘魯"] = {parents = {"南美洲"}, poldiv = {"regions", "provinces", "districts"}},
	["菲律賓"] = {parents = {"亞洲"}, poldiv = {"regions", "provinces", "districts", "municipalities"}},
	["波蘭"] = {poldiv = {"voivodeships", "counties"}, parents = {"歐洲"}, british_spelling = true},
	["葡萄牙"] = {parents = {"歐洲"}, poldiv = {"districts and autonomous regions", "provinces", "municipalities"}, british_spelling = true},
	["卡塔爾"] = {parents = {"亞洲"}, poldiv = {"municipalities", "zones"}},
	["剛果共和國"] = {parents = {"非洲"}, poldiv = {"departments", "districts"}},
	["羅馬尼亞"] = {parents = {"歐洲"}, poldiv = {"regions", "counties"}, british_spelling = true},
	["俄羅斯"] = {parents = {"歐洲", "亞洲"}, poldiv = {"republics", "autonomous oblasts", "autonomous okrugs", "oblasts", "krais", "federal cities", "districts"}, british_spelling = true},
	["盧旺達"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}},
	["聖基茨和尼維斯"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["聖盧西亞"] = {parents = {"北美洲"}, poldiv = {"quarters"}, british_spelling = true},
	["聖文森特和格林納丁斯"] = {parents = {"北美洲"}, poldiv = {"parishes"}, british_spelling = true},
	["薩摩亞"] = {parents = {"玻里尼西亞"}, poldiv = {"districts"}, british_spelling = true},
	["聖馬力諾"] = {parents = {"歐洲"}, poldiv = {"municipalities"}, british_spelling = true},
	["聖多美和普林西比"] = {parents = {"非洲"}, poldiv = {"districts"}},
	["沙特阿拉伯"] = {parents = {"亞洲"}, poldiv = {"provinces", "governorates"}},
	["塞內加爾"] = {parents = {"非洲"}, poldiv = {"regions", "departments"}},
	["塞爾維亞"] = {parents = {"歐洲"}, poldiv = {"districts", "municipalities"}}, 
	["塞舌爾"] = {parents = {"非洲"}, poldiv = {"districts"}, british_spelling = true},
	["塞拉利昂"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["新加坡"] = {parents = {"亞洲"}, poldiv = {"districts"}, british_spelling = true},
	["斯洛伐克"] = {parents = {"歐洲"}, poldiv = {"regions", "districts"}, british_spelling = true},
	["斯洛文尼亞"] = {parents = {"歐洲"}, poldiv = {"municipalities"}, british_spelling = true},
	-- Note: the official name does not include "the" at the beginning, but it sounds strange in
	-- English to leave it out and it's commonly included, so we include it.
	["所羅門群島"] = {parents = {"美拉尼西亞"}, poldiv = {"provinces"}, british_spelling = true},
	["索馬里"] = {parents = {"非洲"}, poldiv = {"regions", "districts"}},
	["南非"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["韓國"] = {parents = {"亞洲", "朝鮮半島"}, poldiv = {"provinces", "counties", "districts"}},
	["南蘇丹"] = {parents = {"非洲"}, poldiv = {"regions", "states"}, british_spelling = true},
	["西班牙"] = {parents = {"歐洲"}, poldiv = {"自治區", "省", "市鎮"}, british_spelling = true},
	["斯里蘭卡"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["蘇丹"] = {parents = {"非洲"}, poldiv = {"states", "districts"}, british_spelling = true},
	["蘇里南"] = {parents = {"南美洲"}, poldiv = {"districts"}},
	["斯威士蘭"] = {parents = {"非洲"}, british_spelling = true},
	["瑞典"] = {parents = {"歐洲"}, poldiv = {"provinces", "counties", "municipalities"}, british_spelling = true},
	["瑞士"] = {parents = {"歐洲"}, poldiv = {"cantons", "municipalities", "districts"}, british_spelling = true},
	["敘利亞"] = {parents = {"亞洲"}, poldiv = {"governorates", "districts"}},
	["臺灣"] = {parents = {"亞洲"}, poldiv = {"counties", "districts"}},
	["塔吉克斯坦"] = {parents = {"亞洲"}, poldiv = {"provinces"}, miscdiv = {"regions", "districts"}},
	["坦桑尼亞"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["泰國"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts"}},
	["多哥"] = {parents = {"非洲"}, poldiv = {"provinces", "prefectures"}},
	["湯加"] = {parents = {"玻里尼西亞"}, poldiv = {"divisions"}, british_spelling = true},
	["特立尼達和多巴哥"] = {parents = {"北美洲"}, poldiv = {"regions", "municipalities"}, british_spelling = true},
	["突尼斯"] = {parents = {"非洲"}, poldiv = {"governorates", "delegations"}},
	["土耳其"] = {parents = {"歐洲", "亞洲"}, poldiv = {"provinces", "districts"}},
	["土庫曼斯坦"] = {parents = {"亞洲"}, poldiv = {"regions", "districts"}},
	["圖瓦盧"] = {parents = {"玻里尼西亞"}, poldiv = {"atolls"}, british_spelling = true},
	["烏干達"] = {parents = {"非洲"}, poldiv = {"districts", "counties"}, british_spelling = true},
	["烏克蘭"] = {parents = {"歐洲"}, poldiv = {"oblasts", "municipalities", "raions"}, british_spelling = true},
	["阿拉伯聯合酋長國"] = {parents = {"亞洲"}, poldiv = {"emirates"}},
	["英國"] = {parents = {"歐洲", "不列顛群島"},
		poldiv = {"countries", "territories", "dependencies"},
		keydesc = "the [[英國]] of Great Britain and Northern Ireland", british_spelling = true},
	["美國"] = {parents = {"北美洲"},
		poldiv = {"counties", "county seats", "states", "territories",
			"municipalities", -- these exist politically at least in Colorado and Connecticut
		}, miscdiv = {"regions"}},
	["烏拉圭"] = {parents = {"南美洲"}, poldiv = {"departments", "municipalities"}},
	["烏茲別克斯坦"] = {parents = {"亞洲"}, poldiv = {"regions", "districts"}},
	["瓦努阿圖"] = {parents = {"美拉尼西亞"}, poldiv = {"provinces"}, british_spelling = true},
	["梵蒂岡"] = {parents = {"歐洲", "羅馬"}, is_city = true, british_spelling = true},
	["委內瑞拉"] = {parents = {"南美洲"}, poldiv = {"states", "municipalities"}},
	["越南"] = {parents = {"亞洲"}, poldiv = {"provinces", "districts", "municipalities"}},
	["西撒哈拉"] = {parents = {"非洲"}},
	["也門"] = {parents = {"亞洲"}, poldiv = {"governorates", "districts"}},
	["贊比亞"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
	["津巴布韋"] = {parents = {"非洲"}, poldiv = {"provinces", "districts"}, british_spelling = true},
}

export.pseudo_countries = {
	-- British Overseas Territory
	["亞克羅提利與德凱利亞"] = {divtype = {"overseas territory", "territory"}, parents = {"塞浦路斯", "歐洲", "英國"}, british_spelling = true},
	-- unincorporated territory of the United States
	["美屬薩摩亞"] = {divtype = {"unincorporated territory", "overseas territory", "territory"}, parents = {"玻里尼西亞", "美國"}},
	["美國本土外小島嶼"] = {divtype = {"unincorporated territory", "overseas territory", "territory"}, parents = {"島嶼", "密克羅尼西亞", "玻里尼西亞", "美國"}},
	-- British Overseas Territory
	["安圭拉"] = {divtype = {"overseas territory", "territory"}, parents = {"北美洲", "英國"}, british_spelling = true},
	-- de-facto independent state, internationally recognized as part of Georgia
	["阿布哈茲"] = {divtype = {"unrecognized state", "country"}, parents = {"格魯吉亞", "歐洲", "亞洲"},
		poldiv = {"districts"},
		keydesc = "the de-facto independent state of [[阿布哈茲]], internationally recognized as part of the country of [[格魯吉亞]]"},
	-- de-facto independent state of Armenian ethnicity, internationally recognized as part of Azerbaijan
	-- (also known as Nagorno-Karabakh)
	-- NOTE: Formerly listed Armenia as a parent; this seems politically non-neutral
	-- so I've taken it out.
	["阿爾察赫"] = {divtype = {"unrecognized state", "country"}, parents = {"阿塞拜疆", "歐洲", "亞洲"},
		keydesc = "the de-facto independent state of [[阿爾察赫]], internationally recognized as part of [[亞塞拜然]]", british_spelling = true},
	-- British Overseas Territory
	["阿森松島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "大西洋"}, british_spelling = true},
	-- constituent country of the Netherlands
	["阿魯巴"] = {divtype = {"constituent country", "country"}, parents = {"荷蘭", "北美洲"}},
	-- British Overseas Territory
	["百慕達"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- British Overseas Territory
	["英屬印度洋領地"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- British Overseas Territory
	["英屬維京群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- British Overseas Territory
	["開曼群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- Australian external territory
	["聖誕島"] = {divtype = {"external territory", "territory"}, parents = {"澳大利亞", "亞洲"}, british_spelling = true},
	-- Australian external territory; also called the Keeling Islands or (officially) the Cocos (Keeling) Islands
	["科科斯(基林)群島"] = {divtype = {"external territory", "territory"}, parents = {"澳大利亞", "亞洲"}, british_spelling = true},
	-- self-governing but in free association with New Zealand
	["庫克群島"] = {divtype = {"country"}, parents = {"玻里尼西亞", "新西蘭"}, british_spelling = true},
	-- constituent country of the Netherlands
	["庫拉索"] = {divtype = {"constituent country", "country"}, parents = {"荷蘭", "北美洲"}},
	-- special territory of Chile
	["復活節島"] = {divtype = {"special territory", "territory"}, parents = {"智利", "玻里尼西亞"}},
	-- British Overseas Territory
	["福克蘭群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "南美洲"}, british_spelling = true},
	-- autonomous territory of Denmark
	["法羅群島"] = {divtype = {"autonomous territory", "territory"}, parents = {"丹麥", "歐洲"}},
	-- overseas department of France
	["法屬圭亞那"] = {divtype = {"overseas department", "department"}, parents = {"法國", "南美洲"}},
	-- overseas collectivity of France
	["法屬玻利尼西亞"] = {divtype = {"overseas collectivity", "collectivity"}, parents = {"法國", "玻里尼西亞"}},
	-- British Overseas Territory
	["直布羅陀"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- autonomous territory of Denmark
	["格陵蘭"] = {divtype = {"autonomous territory", "territory"}, parents = {"丹麥", "北美洲"}, poldiv = {"municipalities"}},
	-- overseas department of France
	["瓜德羅普"] = {divtype = {"overseas department", "department"}, parents = {"法國", "北美洲"}},
	-- unincorporated territory of the United States
	["關島"] = {divtype = {"unincorporated territory", "overseas territory", "territory"}, parents = {"美國", "密克羅尼西亞"}},
	-- self-governing British Crown dependency; technically called the Bailiwick of Guernsey
	["根西"] = {divtype = {"crown dependency", "dependency", "bailiwick", "territory"}, parents = {"不列顛群島", "歐洲"}, british_spelling = true},
	-- special administrative region of China
	["香港"] = {divtype = "special administrative region", parents = {"中國"}},
	-- self-governing British Crown dependency
	["曼島"] = {divtype = {"crown dependency", "dependency", "territory"}, parents = {"不列顛群島", "歐洲"}, british_spelling = true},
	-- self-governing British Crown dependency; technically called the Bailiwick of Jersey
	["澤西"] = {divtype = {"crown dependency", "dependency", "bailiwick", "territory"}, parents = {"不列顛群島", "歐洲"}, british_spelling = true},
	-- special administrative region of China
	["澳門"] = {divtype = "special administrative region", parents = {"中國"}},
	-- overseas department of France
	["馬提尼克"] = {divtype = {"overseas department", "department"}, parents = {"法國", "北美洲"}},
	-- British Overseas Territory
	["蒙特塞拉特"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- special collectivity of France
	["新喀里多尼亞"] = {divtype = {"special collectivity", "collectivity"}, parents = {"法國", "美拉尼西亞"}},
	-- self-governing but in free association with New Zealand
	["紐埃"] = {divtype = {"country"}, parents = {"玻里尼西亞", "新西蘭"}, british_spelling = true},
	-- Australian external territory
	["諾福克島"] = {divtype = {"external territory", "territory"}, parents = {"澳大利亞", "玻里尼西亞"}, british_spelling = true},
	-- commonwealth, unincorporated territory of the United States
	["北馬里亞納群島"] = {divtype = {"commonwealth", "unincorporated territory", "overseas territory", "territory"}, parents = {"美國", "密克羅尼西亞"}},
	-- British Overseas Territory
	["皮特凱恩群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "玻里尼西亞"}, british_spelling = true},
	-- commonwealth of the United States
	["波多黎各"] = {divtype = {"commonwealth", "overseas territory", "territory"}, parents = {"美國", "北美洲"}},
	-- overseas collectivity of France
	["聖巴泰勒米"] = {divtype = {"overseas collectivity", "collectivity"}, parents = {"法國", "北美洲"}},
	-- British Overseas Territory
	["聖赫倫那"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "大西洋"}, british_spelling = true},
	-- overseas collectivity of France
	["法屬聖馬丁"] = {divtype = {"overseas collectivity", "collectivity"}, parents = {"法國", "北美洲"}},
	-- overseas collectivity of France
	["聖皮埃爾和密克隆"] = {divtype = {"overseas collectivity", "collectivity"}, parents = {"法國", "北美洲"}},
	-- de-facto independent state, internationally recognized as part of Georgia
	["南奧塞梯"] = {divtype = {"unrecognized state", "country"}, parents = {"格魯吉亞", "歐洲", "亞洲"},
		keydesc = "[[南奧塞梯]],事實上的獨立國家,國際上則公認為[[格魯吉亞]]的一部分", british_spelling = true},
	-- constituent country of the Netherlands
	["荷屬聖馬丁"] = {divtype = {"constituent country", "country"}, parents = {"荷蘭", "北美洲"}},
	-- British Overseas Territory
	["南喬治亞"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "大西洋"}, british_spelling = true},
	-- British Overseas Territory
	["南桑威奇群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "大西洋"}, british_spelling = true},
	-- dependent territory of New Zealnd
	["托克勞"] = {divtype = {"dependent territory", "territory"}, parents = {"新西蘭", "玻里尼西亞"}, british_spelling = true},
	-- de-facto independent state, internationally recognized as part of Moldova
	["德涅斯特河沿岸"] = {divtype = {"unrecognized state", "country"}, parents = {"摩爾多瓦", "歐洲"},
		keydesc = "the de-facto independent state of [[德涅斯特河沿岸]], internationally recognized as part of [[摩爾多瓦]]", british_spelling = true},
	-- British Overseas Territory
	["特里斯坦-達庫尼亞"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "大西洋"}, british_spelling = true},
	-- British Overseas Territory
	["特克斯和凱科斯群島"] = {divtype = {"overseas territory", "territory"}, parents = {"英國", "北美洲"}, british_spelling = true},
	-- unincorporated territory of the United States
	["美屬維京群島"] = {divtype = {"unincorporated territory", "overseas territory", "territory"}, parents = {"美國", "北美洲"}},
	-- unincorporated territory of the United States
	["威克島"] = {divtype = {"unincorporated territory", "overseas territory", "territory"}, parents = {"美國", "北美洲"}},
	-- overseas collectivity of France
	["瓦利斯和富圖納"] = {divtype = {"overseas collectivity", "collectivity"}, parents = {"法國", "玻里尼西亞"}},
}

export.former_countries = {
	["捷克斯洛伐克"] = {parents = {"歐洲"}, british_spelling = true},
	["東德"] = {parents = {"歐洲", "德國"}, british_spelling = true},
	["越南民主共和國"] = {parents = {"亞洲", "越南"}},
	["伊朗"] = {parents = {"亞洲"}, poldiv = {"provinces"}},
	["羅馬帝國"] = {divtype = {"empire", "country"}, parents = {"歐洲", "非洲", "亞洲", "羅馬"}, poldiv = {"provinces"}},
	["越南共和國"] = {parents = {"亞洲", "越南"}},
	["蘇聯"] = {parents = {"歐洲", "亞洲"}, poldiv = {"republics", "autonomous republics"}, british_spelling = true},
	["西德"] = {parents = {"歐洲", "德國"}, british_spelling = true},
	["南斯拉夫"] = {parents = {"歐洲"}, poldiv = {"districts"},
		keydesc = "前[[南斯拉夫王國]](1918-1943)或前[[南斯拉夫社會主義聯邦共和國]](1943-1992)", british_spelling = true},
}

export.australian_states_and_territories = {
	["新南威爾斯州"] = {},
	["北領地"] = {divtype = "territory"},
	["昆士蘭州"] = {},
	["南澳大利亞州"] = {},
	["塔斯馬尼亞州"] = {},
	["維多利亞"] = {},
	["西澳大利亞州"] = {},
}

export.austrian_states = {
	["維也納"] = {},
	["下奧地利州"] = {},
	["上奧地利州"] = {},
	["施泰爾馬克州"] = {},
	["蒂羅爾"] = {},
	["克恩頓州"] = {},
	["薩爾茨堡"] = {},
	["福拉爾貝格州"] = {},
	["布爾根蘭州"] = {},
}

export.brazilian_states = {
	["巴西阿克里州"] = {},
	["巴西阿拉戈斯州"] = {},
	["巴西阿馬帕州"] = {},
	["巴西亞馬孫州"] = {},
	["巴西巴伊亞州"] = {},
	["巴西塞阿拉州"] = {},
	["巴西聯邦區"] = {},
	["巴西聖埃斯皮里圖州"] = {},
	["巴西戈亞斯州"] = {},
	["巴西馬拉尼昂州"] = {},
	["巴西馬托格羅索州"] = {},
	["巴西南馬托格羅索州"] = {},
	["巴西米納斯吉拉斯州"] = {},
	["巴西帕拉州"] = {},
	["巴西帕拉伊巴州"] = {},
	["巴西巴拉那州"] = {},
	["巴西伯南布哥州"] = {},
	["巴西皮奧伊州"] = {},
	["巴西里約熱內盧"] = {},
	["巴西北里約格朗德州"] = {},
	["巴西南里約格朗德州"] = {},
	["巴西朗多尼亞州"] = {},
	["巴西羅賴馬州"] = {},
	["巴西聖卡塔琳娜州"] = {},
	["巴西聖保羅"] = {},
	["巴西塞爾希培州"] = {},
	["巴西托坎廷斯州"] = {},
}

local rural_municipalities = {"rural municipalities", parent="rural municipalities"}
local canadian_counties = {"counties", parent="counties of Canada"}
export.canadian_provinces_and_territories = {
	["艾伯塔省"] = {poldiv = {"municipal districts"}},
	["不列顛哥倫比亞省"] = {poldiv = {"regional districts", "regional municipalities"}},
	["曼尼托巴省"] = {poldiv = {rural_municipalities}},
	["新不倫瑞克省"] = {poldiv = {canadian_counties}},
	["紐芬蘭與拉布拉多省"] = {},
	["西北地區"] = {divtype = "territory"},
	["新斯科舍省"] = {poldiv = {canadian_counties, "regional municipalities"}},
	["努納武特地區"] = {divtype = "territory"},
	["安大略省"] = {poldiv = {canadian_counties, "regional municipalities"}},
	["愛德華王子島省"] = {poldiv = {canadian_counties, rural_municipalities}},
	["薩斯喀徹溫省"] = {poldiv = {rural_municipalities}},
	["魁北克省"] = {poldiv = {canadian_counties, "regional county municipalities"}},
	["育空地區"] = {divtype = "territory"},
}

-- table of Chinese provinces and autonomous regions; interpolated into the main 'places' table, but also needed separately
export.chinese_provinces_and_autonomous_regions = {
	["安徽"] = {},
	["福建"] = {},
	["甘肅"] = {},
	["廣東"] = {},
	["廣西"] = {divtype = "autonomous region"},
	["貴州"] = {},
	["海南"] = {},
	["河北"] = {},
	["黑龍江"] = {},
	["河南"] = {},
	["湖北"] = {},
	["湖南"] = {},
	["內蒙古"] = {divtype = "autonomous region"},
	["江蘇"] = {},
	["江西"] = {},
	["吉林"] = {},
	["遼寧"] = {},
	["寧夏"] = {divtype = "autonomous region"},
	["青海"] = {},
	["陝西"] = {},
	["山東"] = {},
	["山西"] = {},
	["四川"] = {},
	["西藏"] = {divtype = "autonomous region"},
	["新疆"] = {divtype = "autonomous region"},
	["雲南"] = {},
	["浙江"] = {},
}

export.finnish_regions = {
	["芬蘭拉普蘭區"] = {},
	["North Ostrobothnia, Finland"] = {},
	["Kainuu, Finland"] = {},
	["North Karelia, Finland"] = {},
	["Northern Savonia, Finland"] = {},
	["Southern Savonia, Finland"] = {},
	["South Karelia, Finland"] = {},
	["Central Finland, Finland"] = {},
	["South Ostrobothnia, Finland"] = {},
	["Ostrobothnia, Finland"] = {},
	["Central Ostrobothnia, Finland"] = {},
	["Pirkanmaa, Finland"] = {},
	["Satakunta, Finland"] = {},
	["Päijänne Tavastia, Finland"] = {},
	["Tavastia Proper, Finland"] = {},
	["Kymenlaakso, Finland"] = {},
	["芬蘭新地區"] = {},
	["Southwest Finland, Finland"] = {},
	["the Åland Islands, Finland"] = {},
}

export.french_regions = {
	["奧弗涅-羅訥-阿爾卑斯"] = {},
	["勃艮第-弗朗什-孔泰"] = {},
	["布列塔尼"] = {},
	["中央-羅亞爾河谷"] = {},
	["科西嘉"] = {},
	["法屬圭亞那"] = {},
	["大東部"] = {},
	["瓜德羅普"] = {},
	["上法蘭西"] = {},
	["法蘭西島"] = {},
	["馬提尼克"] = {},
	["馬約特"] = {},
	["諾曼第"] = {},
	["新阿基坦"] = {},
	["奧克西塔尼"] = {},
	["羅亞爾河地區"] = {},
	["普羅旺斯-阿爾卑斯-藍色海岸"] = {},
	["留尼旺"] = {},
}

export.german_states = {
	["巴登-符騰堡"] = {},
	["巴伐利亞"] = {},
	["柏林"] = {},
	["布蘭登堡"] = {},
	["不萊梅"] = {},
	["漢堡"] = {},
	["黑森"] = {},
	["下薩克森"] = {},
	["梅克倫堡-前波莫瑞"] = {},
	["北萊茵-威斯伐倫"] = {},
	["萊茵蘭-普法爾茨"] = {},
	["薩爾蘭"] = {},
	["薩克森"] = {},
	["薩克森-安哈特"] = {},
	["什勒斯維希-霍爾斯坦"] = {},
	["圖林根"] = {},
}

-- Indian states and union territories. Only some of them are divided into
-- divisions.
export.indian_states_and_union_territories = {
	["安達曼-尼科巴群島"] = {divtype = "union territory"},
	["安得拉邦"] = {},
	["阿魯納恰爾邦"] = {poldiv = {"divisions"}},
	["阿薩姆邦"] = {poldiv = {"divisions"}},
	["比哈爾邦"] = {poldiv = {"divisions"}},
	["昌迪加爾"] = {divtype = "union territory"},
	["恰蒂斯加爾邦"] = {poldiv = {"divisions"}},
	["達德拉-納加爾哈維利縣"] = {divtype = "union territory"},
	["達曼-第烏"] = {divtype = "union territory"},
	["德里"] = {divtype = "union territory", poldiv = {"divisions"}},
	["果阿邦"] = {},
	["古吉拉特邦"] = {},
	["哈里亞納邦"] = {poldiv = {"divisions"}},
	["喜馬偕爾邦"] = {poldiv = {"divisions"}},
	["查謨和克什米爾"] = {divtype = "union territory", poldiv = {"divisions"}},
	["賈坎德邦"] = {poldiv = {"divisions"}},
	["卡納塔卡邦"] = {poldiv = {"divisions"}},
	["喀拉拉邦"] = {},
	["拉達克"] = {divtype = "union territory", poldiv = {"divisions"}},
	["拉克沙群島"] = {divtype = "union territory"},
	["中央邦"] = {poldiv = {"divisions"}},
	["馬哈拉施特拉邦"] = {poldiv = {"divisions"}},
	["曼尼普爾邦"] = {},
	["梅加拉亞邦"] = {poldiv = {"divisions"}},
	["米佐拉姆邦"] = {},
	["那加蘭邦"] = {poldiv = {"divisions"}},
	["奧里薩邦"] = {poldiv = {"divisions"}},
	["朋迪治里市"] = {divtype = "union territory"},
	["旁遮普地區"] = {poldiv = {"divisions"}},
	["拉賈斯坦邦"] = {poldiv = {"divisions"}},
	["錫金邦"] = {},
	["泰米爾納德邦"] = {},
	["泰倫加納邦"] = {},
	["特里普拉邦"] = {},
	["北方邦"] = {poldiv = {"divisions"}},
	["北阿坎德邦"] = {poldiv = {"divisions"}},
	["西孟加拉邦"] = {poldiv = {"divisions"}},
}

export.indonesian_provinces = {
	["亞齊特區"] = {},
	["峇里省"] = {},
	["邦加-勿里洞省"] = {},
	["萬丹省"] = {},
	["明古魯省"] = {},
	["中爪哇省"] = {},
	["中加里曼丹省"] = {},
	["中蘇拉威西省"] = {},
	["東爪哇省"] = {},
	["東加里曼丹省"] = {},
	["東努沙登加拉省"] = {},
	["哥倫打洛省"] = {},
	["雅加達"] = {},
	["占碑省"] = {},
	["楠榜省"] = {},
	["馬魯古省"] = {},
	["北加里曼丹省"] = {},
	["北馬魯古省"] = {},
	["北蘇拉威西省"] = {},
	["北蘇門答臘省"] = {},
	["巴布亞"] = {},
	["廖內省"] = {},
	["廖內群島省"] = {},
	["東南蘇拉威西省"] = {},
	["南加里曼丹省"] = {},
	["南蘇拉威西省"] = {},
	["南蘇門答臘省"] = {},
	["西爪哇省"] = {},
	["西加里曼丹省"] = {},
	["西努沙登加拉省"] = {},
	["西巴布亞省"] = {},
	["西蘇拉威西省"] = {},
	["西蘇門答臘省"] = {},
	["日惹特區"] = {},
}

export.irish_counties = {
	["愛爾蘭卡洛郡"] = {},
	["愛爾蘭卡文郡"] = {},
	["愛爾蘭克萊爾郡"] = {},
	["愛爾蘭科克郡"] = {},
	["愛爾蘭多尼戈爾郡"] = {},
	["愛爾蘭都柏林郡"] = {},
	["愛爾蘭戈爾韋郡"] = {},
	["愛爾蘭凱里郡"] = {},
	["愛爾蘭基爾代爾郡"] = {},
	["愛爾蘭基爾肯尼郡"] = {},
	["愛爾蘭萊伊什郡"] = {},
	["愛爾蘭利特里姆郡"] = {},
	["愛爾蘭利默里克郡"] = {},
	["愛爾蘭朗福德郡"] = {},
	["愛爾蘭勞斯郡"] = {},
	["愛爾蘭梅奧郡"] = {},
	["愛爾蘭米斯郡"] = {},
	["愛爾蘭莫納亨郡"] = {},
	["愛爾蘭奧法利郡"] = {},
	["愛爾蘭羅斯康芒郡"] = {},
	["愛爾蘭斯萊戈郡"] = {},
	["愛爾蘭蒂珀雷里郡"] = {},
	["愛爾蘭沃特福德郡"] = {},
	["愛爾蘭韋斯特米斯郡"] = {},
	["愛爾蘭韋克斯福德郡"] = {},
	["愛爾蘭威克洛郡"] = {},
}

export.italian_regions = {
	["阿布魯佐大區"] = {},
	["瓦萊達奧斯塔大區"] = {divtype = {"autonomous region", "region"}},
	["普利亞大區"] = {},
	["巴西利卡塔大區"] = {},
	["卡拉布里亞大區"] = {},
	["坎帕尼亞大區"] = {},
	["艾米利亞-羅馬涅大區"] = {},
	["弗留利-威尼斯朱利亞大區"] = {divtype = {"autonomous region", "region"}},
	["拉齊奧大區"] = {},
	["利古里亞大區"] = {},
	["倫巴第大區"] = {},
	["馬爾凱大區"] = {},
	["莫利塞大區"] = {},
	["皮埃蒙特大區"] = {},
	["撒丁島"] = {divtype = {"autonomous region", "region"}},
	["西西里島"] = {divtype = {"autonomous region", "region"}},
	["特倫蒂諾-上阿迪傑大區"] = {divtype = {"autonomous region", "region"}},
	["托斯卡納大區"] = {},
	["翁布里亞大區"] = {},
	["威尼托大區"] = {},
}

-- table of Japanese prefectures; interpolated into the main 'places' table, but also needed separately
export.japanese_prefectures = {
	["愛知縣"] = {},
	["秋田縣"] = {},
	["青森縣"] = {},
	["千葉縣"] = {},
	["愛媛縣"] = {},
	["福井縣"] = {},
	["福岡縣"] = {},
	["福島縣"] = {},
	["岐阜縣"] = {},
	["群馬縣"] = {},
	["廣島縣"] = {},
	["北海道"] = {poldiv = {{"支廳", parent="日本支廳"}}},
	["兵庫縣"] = {},
	["茨城縣"] = {},
	["石川縣"] = {},
	["岩手縣"] = {},
	["香川縣"] = {},
	["鹿兒島縣"] = {},
	["神奈川縣"] = {},
	["高知縣"] = {},
	["熊本縣"] = {},
	["京都府"] = {},
	["三重縣"] = {},
	["宮城縣"] = {},
	["宮崎縣"] = {},
	["長野縣"] = {},
	["長崎縣"] = {},
	["奈良縣"] = {},
	["新潟縣"] = {},
	["大分縣"] = {},
	["岡山縣"] = {},
	["沖繩縣"] = {},
	["大阪府"] = {},
	["佐賀縣"] = {},
	["埼玉縣"] = {},
	["滋賀縣"] = {},
	["島根縣"] = {},
	["靜岡縣"] = {},
	["栃木縣"] = {},
	["德島縣"] = {},
	["東京都"] = {poldiv = {"區部", {"支廳", parent="日本支廳"}}},
	["鳥取縣"] = {},
	["富山縣"] = {},
	["和歌山縣"] = {},
	["山形縣"] = {},
	["山口縣"] = {},
	["山梨縣"] = {},
}

local function japanese_placename_to_key(placename)
	if placename == "京都" or placename == "大阪" then
		return placename .. "府"
	end
	if placename == "北海道" or placename == "東京都" then
		return placename
	end
	return placename .. "縣"
end

export.maltese_regions = {
	["Central Region, Malta"] = {},
	["Gozo Region, Malta"] = {},
	["Northern Region, Malta"] = {},
	["South Eastern Region, Malta"] = {},
	["Southern Region, Malta"] = {},
}

export.mexican_states = {
	["阿瓜斯卡連特斯州"] = {},
	["下加利福尼亞州"] = {},
	["南下加利福尼亞州"] = {},
	["坎佩切州"] = {},
	["恰帕斯州"] = {},
	["墨西哥城"] = {},
	["奇瓦瓦州"] = {},
	["科阿韋拉州"] = {},
	["科利馬州"] = {},
	["杜蘭戈州"] = {},
	["瓜納華托州"] = {},
	["格雷羅州"] = {},
	["伊達爾戈州"] = {},
	["哈利斯科州"] = {},
	["墨西哥州"] = {},
	["米卻肯州"] = {},
	["莫雷洛斯州"] = {},
	["納亞里特州"] = {},
	["新萊昂州"] = {},
	["瓦哈卡州"] = {},
	["普埃布拉州"] = {},
	["克雷塔羅州"] = {},
	["金塔納羅奧州"] = {},
	["聖路易斯波托西州"] = {},
	["錫那羅亞州"] = {},
	["索諾拉州"] = {},
	["塔巴斯科州"] = {},
	["塔毛利帕斯州"] = {},
	["特拉斯卡拉州"] = {},
	["韋拉克魯斯州"] = {},
	["尤卡坦州"] = {},
	["薩卡特卡斯州"] = {},
}
		
export.moroccan_regions = {
	["丹吉爾-得土安-胡塞馬大區"] = {},
	["Oriental"] = {},
	["非斯-梅克內斯大區"] = {},
	["拉巴特-塞拉-蓋尼特拉大區"] = {},
	["Beni Mellal-Khenifra"] = {},
	["卡薩布蘭卡-塞塔特大區"] = {},
	["馬拉喀什-薩菲大區"] = {},
	["Draa-Tafilalet"] = {},
	["蘇斯-馬塞大區"] = {},
	["蓋勒敏-農河大區"] = {},
	["阿尤恩-薩基亞-阿姆拉大區"] = {},
	["達赫拉-黃金谷地大區"] = {},
}

export.netherlands_provinces = {
	["德倫特省"] = {},
	["Flevoland, Netherlands"] = {},
	["Friesland, Netherlands"] = {},
	["Gelderland, Netherlands"] = {},
	["格羅寧根"] = {},
	["林堡省 (荷蘭)"] = {},
	["North Brabant, Netherlands"] = {},
	["North Holland, Netherlands"] = {},
	["Overijssel, Netherlands"] = {},
	["South Holland, Netherlands"] = {},
	["烏得勒支"] = {},
	["澤蘭省"] = {},
}

export.norwegian_counties = {
	["東福爾"] = {},
	["阿克什胡斯"] = {},
	["奧斯陸"] = {},
	["海德馬克"] = {},
	["奧普蘭"] = {},
	["布斯克呂"] = {},
	["西福爾"] = {},
	["泰勒馬克"] = {},
	["東阿格德爾"] = {},
	["西阿格德爾"] = {},
	["羅加蘭郡"] = {},
	["霍達蘭"] = {},
	["松恩-菲尤拉訥"] = {},
	["默勒-魯姆斯達爾郡"] = {},
	["諾爾蘭郡"] = {},
	["特羅姆斯"] = {},
	["芬馬克"] = {},
	["特倫德拉格郡"] = {},
}

export.philippine_provinces = {
	["Abra, Philippines"] = {},
	["Agusan del Norte, Philippines"] = {},
	["Agusan del Sur, Philippines"] = {},
	["Aklan, Philippines"] = {},
	["Albay, Philippines"] = {},
	["安蒂克省"] = {},
	["Apayao, Philippines"] = {},
	["奧羅拉省"] = {},
	["Basilan, Philippines"] = {},
	["Bataan, Philippines"] = {},
	["Batanes, Philippines"] = {},
	["八打雁省"] = {},
	["Benguet, Philippines"] = {},
	["Biliran, Philippines"] = {},
	["Bohol, Philippines"] = {},
	["Bukidnon, Philippines"] = {},
	["布拉干省"] = {},
	["Cagayan, Philippines"] = {},
	["Camarines Norte, Philippines"] = {},
	["南甘馬粦省"] = {},
	["Camiguin, Philippines"] = {},
	["Capiz, Philippines"] = {},
	["Catanduanes, Philippines"] = {},
	["甲米地省"] = {},
	["宿霧省"] = {},
	["Cotabato, Philippines"] = {},
	["Davao de Oro, Philippines"] = {},
	["Davao del Norte, Philippines"] = {},
	["Davao del Sur, Philippines"] = {},
	["Davao Occidental, Philippines"] = {},
	["Davao Oriental, Philippines"] = {},
	["Dinagat Islands, Philippines"] = {},
	["Eastern Samar, Philippines"] = {},
	["Guimaras, Philippines"] = {},
	["伊富高省"] = {},
	["Ilocos Norte, Philippines"] = {},
	["Ilocos Sur, Philippines"] = {},
	["伊洛伊洛省"] = {},
	["Isabela, Philippines"] = {},
	["Kalinga, Philippines"] = {},
	["La Union, Philippines"] = {},
	["內湖省"] = {},
	["Lanao del Norte, Philippines"] = {},
	["Lanao del Sur, Philippines"] = {},
	["萊特島"] = {},
	["Maguindanao, Philippines"] = {},
	["Marinduque, Philippines"] = {},
	["馬斯巴特省"] = {},
	["Misamis Occidental, Philippines"] = {},
	["Misamis Oriental, Philippines"] = {},
	["Mountain Province, Philippines"] = {},
	["Negros Occidental, Philippines"] = {},
	["Negros Oriental, Philippines"] = {},
	["Northern Samar, Philippines"] = {},
	["新怡詩夏省"] = {},
	["Nueva Vizcaya, Philippines"] = {},
	["Occidental Mindoro, Philippines"] = {},
	["Oriental Mindoro, Philippines"] = {},
	["Palawan, Philippines"] = {},
	["邦板牙省"] = {},
	["Pangasinan, Philippines"] = {},
	["Quezon, Philippines"] = {},
	["Quirino, Philippines"] = {},
	["黎剎省"] = {},
	["朗布隆省"] = {},
	["Samar, Philippines"] = {},
	["Sarangani, Philippines"] = {},
	["Siquijor, Philippines"] = {},
	["Sorsogon, Philippines"] = {},
	["South Cotabato, Philippines"] = {},
	["Southern Leyte, Philippines"] = {},
	["Sultan Kudarat, Philippines"] = {},
	["Sulu, Philippines"] = {},
	["Surigao del Norte, Philippines"] = {},
	["Surigao del Sur, Philippines"] = {},
	["Tarlac, Philippines"] = {},
	["Tawi-Tawi, Philippines"] = {},
	["Zambales, Philippines"] = {},
	["Zamboanga del Norte, Philippines"] = {},
	["Zamboanga del Sur, Philippines"] = {},
	["Zamboanga Sibugay, Philippines"] = {},
	["馬尼拉大都會"] = {},
}

export.russian_federal_subjects = {
	-- autonomous oblasts
	["猶太自治州"] = {divtype = {"autonomous oblast", "oblast"}},
	-- autonomous okrugs
	["楚科奇自治區"] = {divtype = "autonomous okrug"},
	["漢特-曼西自治區"] = {divtype = "autonomous okrug"},
	["涅涅茨自治區"] = {divtype = "autonomous okrug"},
	["亞馬爾-涅涅茨自治區"] = {divtype = "autonomous okrug"},
	-- krais
	["阿爾泰邊疆區"] = {divtype = "krai"},
	["堪察加邊疆區"] = {divtype = "krai"},
	["哈巴羅夫斯克邊疆區"] = {divtype = "krai"},
	["克拉斯諾達爾邊疆區"] = {divtype = "krai"},
	["克拉斯諾亞爾斯克邊疆區"] = {divtype = "krai"},
	["彼爾姆邊疆區"] = {divtype = "krai"},
	["濱海邊疆區"] = {divtype = "krai"},
	["斯塔夫羅波爾邊疆區"] = {divtype = "krai"},
	["外貝加爾邊疆區"] = {divtype = "krai"},
	-- oblasts
	["阿穆爾州"] = {},
	["阿爾漢格爾斯克州"] = {},
	["阿斯特拉罕州"] = {},
	["別爾哥羅德州"] = {},
	["布良斯克州"] = {},
	["車里雅賓斯克州"] = {},
	["伊爾庫茨克州"] = {},
	["伊萬諾沃州"] = {},
	["加里寧格勒州"] = {},
	["卡盧加州"] = {},
	["克麥羅沃州"] = {},
	["基洛夫州"] = {},
	["科斯特羅馬州"] = {},
	["庫爾干州"] = {},
	["庫爾斯克州"] = {},
	["列寧格勒州"] = {},
	["利佩茨克州"] = {},
	["馬加丹州"] = {},
	["莫斯科州"] = {},
	["摩爾曼斯克州"] = {},
	["下諾夫哥羅德州"] = {},
	["諾夫哥羅德州"] = {},
	["新西伯利亞州"] = {},
	["鄂木斯克州"] = {},
	["奧倫堡州"] = {},
	["奧廖爾州"] = {},
	["奔薩州"] = {},
	["普斯科夫州"] = {},
	["羅斯托夫州"] = {},
	["梁贊州"] = {},
	["薩哈林州"] = {},
	["薩馬拉州"] = {},
	["薩拉托夫州"] = {},
	["斯摩棱斯克州"] = {},
	["斯維爾德洛夫斯克州"] = {},
	["坦波夫州"] = {},
	["托木斯克州"] = {},
	["圖拉州"] = {},
	["特維爾州"] = {},
	["秋明州"] = {},
	["烏里揚諾夫斯克州"] = {},
	["弗拉基米爾州"] = {},
	["伏爾加格勒州"] = {},
	["沃洛格達州"] = {},
	["沃羅涅日州"] = {},
	["雅羅斯拉夫爾州"] = {},
	-- republics
	["阿迪格共和國"] = {divtype = "republic"},
	["巴什科爾托斯坦共和國"] = {divtype = "republic"},
	["布里亞特共和國"] = {divtype = "republic"},
	["達吉斯坦共和國"] = {divtype = "republic"},
	["印古什共和國"] = {divtype = "republic"},
	["卡爾梅克共和國"] = {divtype = "republic"},
	["卡累利阿共和國"] = {divtype = "republic"},
	["哈卡斯共和國"] = {divtype = "republic"},
	["摩爾多瓦共和國"] = {divtype = "republic"},
	["北奧塞提亞-阿蘭共和國"] = {divtype = "republic"},
	["韃靼斯坦共和國"] = {divtype = "republic"},
	["阿爾泰共和國"] = {divtype = "republic"},
	["車臣共和國"] = {divtype = "republic"},
	["楚瓦什共和國"] = {divtype = "republic"},
	["卡巴爾達-巴爾卡爾共和國"] = {divtype = "republic"},
	["卡拉恰伊-切爾克斯共和國"] = {divtype = "republic"},
	["科米共和國"] = {divtype = "republic"},
	["馬里埃爾共和國"] = {divtype = "republic"},
	["薩哈共和國"] = {divtype = "republic"},
	["圖瓦共和國"] = {divtype = "republic"},
	["烏德穆爾特共和國"] = {divtype = "republic"},
	-- Not sure what to do about this one from a neutrality perspective
	-- ["the Republic of Crimea"] = {divtype = "republic"},
	-- There are also federal cities (not included because they're cities):
	-- Moscow, Saint Petersburg, Sevastopol (not sure what to do about the
	-- last one if we were to include federal cities, see "Republic of Crimea"
	-- above)
}

local function russian_placename_to_key(placename)
	-- We allow the user to say e.g. "obl/Samara" and "rep/Tatarstan" in place of
	-- "obl/Samara Oblast" and "rep/Republic of Tatarstan".
	if export.russian_federal_subjects[placename] or export.russian_federal_subjects["the " .. placename] then
		return placename
	end
	for _, suffix in ipairs({"Autonomous Okrug", "Krai", "Oblast"}) do
		local suffixed_placename = placename .. " " .. suffix
		if export.russian_federal_subjects[suffixed_placename] then
			return suffixed_placename
		end
	end
	local republic_placename = "Republic of " .. placename
	if export.russian_federal_subjects["the " .. republic_placename] then
		return republic_placename
	end
	local republic_placename = placename .. " Republic"
	if export.russian_federal_subjects["the " .. republic_placename] then
		return republic_placename
	end
	return placename
end

export.spanish_autonomous_communities = {
	["安達盧西亞"] = {},
	["阿拉貢"] = {},
	["阿斯圖里亞斯"] = {},
	["巴利阿里群島"] = {},
	["巴斯克地區"] = {},
	["加那利群島"] = {},
	["坎塔布里亞"] = {},
	["卡斯蒂利亞-萊昂"] = {},
	["卡斯蒂利亞-拉曼恰"] = {},
	["加泰隆尼亞"] = {},
	["馬德里自治區"] = {},
	["埃斯特雷馬杜拉"] = {},
	["加利西亞"] = {},
	["拉里奧哈"] = {},
	["穆爾西亞"] = {},
	["納瓦拉"] = {},
	["瓦倫西亞"] = {},
}

export.uk_constituent_countries = {
	["英格蘭"] = {poldiv = {"regions", "counties", "districts", "civil parishes"}},
	["北愛爾蘭"] = {divtype = "province", parents = {"英國", "愛爾蘭"},
		poldiv = {"districts"}, miscdiv = {"traditional counties"}},
	["蘇格蘭"] = {poldiv = {"council areas"}, miscdiv = {"regions", "districts", "traditional counties"}},
	["威爾士"] = {poldiv = {"counties", "county boroughs"}},
}

-- table of US states; interpolated into the main 'places' table, but also needed separately
export.us_states = {
	["美國阿拉巴馬州"] = {},
	["美國阿拉斯加州"] = {poldiv = {
		{"boroughs", parent="counties of the United States"},
		{"borough seats", parent="county seats of the United States"},
	}},
	["美國亞利桑那州"] = {},
	["美國阿肯色州"] = {},
	["美國加利福尼亞州"] = {},
	["美國科羅拉多州"] = {},
	["美國康乃狄克州"] = {},
	["美國德拉瓦州"] = {},
	["美國佛羅里達州"] = {},
	["美國喬治亞州"] = {},
	["美國夏威夷州"] = {parents = {"美國", "玻里尼西亞"}},
	["美國愛達荷州"] = {},
	["美國伊利諾州"] = {},
	["美國印第安納州"] = {},
	["美國愛荷華州"] = {},
	["美國堪薩斯州"] = {},
	["美國肯塔基州"] = {},
	["美國路易斯安那州"] = {poldiv = {
		{"parishes", parent="counties of the United States"},
		{"parish seats", parent="county seats of the United States"},
	}},
	["美國緬因州"] = {},
	["美國馬里蘭州"] = {},
	["美國麻薩諸塞州"] = {},
	["美國密西根州"] = {},
	["美國明尼蘇達州"] = {},
	["美國密西西比州"] = {},
	["美國密蘇里州"] = {},
	["美國蒙大拿州"] = {},
	["美國內布拉斯加州"] = {},
	["美國內華達州"] = {},
	["美國新罕布夏州"] = {},
	["美國新澤西州"] = {},
	["美國新墨西哥州"] = {},
	["美國紐約州"] = {},
	["美國北卡羅萊納州"] = {},
	["美國北達科他州"] = {},
	["美國俄亥俄州"] = {},
	["美國奧克拉荷馬州"] = {},
	["美國奧勒岡州"] = {},
	["美國賓夕法尼亞州"] = {},
	["美國羅德島"] = {},
	["美國南卡羅萊納州"] = {},
	["美國南達科他州"] = {},
	["美國田納西州"] = {},
	["美國德克薩斯州"] = {},
	["美國猶他州"] = {},
	["美國佛蒙特州"] = {},
	["美國維吉尼亞州"] = {},
	["美國華盛頓州"] = {},
	["美國西維吉尼亞州"] = {},
	["美國威斯康辛州"] = {},
	["美國懷俄明州"] = {},
}

export.english_counties = {
	-- ["Avon, England"] = {}, -- no longer
	["英格蘭貝德福德郡"] = {},
	["英格蘭伯克郡"] = {},
	-- ["Brighton and Hove, England"] = {}, -- city
	-- ["布里斯托"] = {}, -- city
	["英格蘭白金漢郡"] = {},
	["英格蘭劍橋郡"] = {},
	-- ["Cambridgeshire and Isle of Ely, England"] = {}, -- no longer
	["英格蘭柴郡"] = {},
	-- ["克利夫蘭 (英國)"] = {}, -- no longer
	["英格蘭康瓦爾郡"] = {},
	-- ["坎伯蘭"] = {}, -- no longer
	["英格蘭坎布里亞郡"] = {},
	["英格蘭德比郡"] = {},
	["英格蘭德文郡"] = {},
	["英格蘭多塞特郡"] = {},
	["英格蘭達勒姆郡"] = {},
	-- ["East Suffolk, England"] = {}, -- no longer
	["英格蘭東薩塞克斯郡"] = {},
	["英格蘭埃塞克斯郡"] = {},
	["英格蘭格洛斯特郡"] = {},
	["英格蘭大倫敦"] = {},
	["英格蘭大曼徹斯特郡"] = {},
	["英格蘭漢普郡"] = {},
	-- ["Hereford and Worcester, England"] = {}, -- no longer
	["英格蘭赫里福德郡"] = {}, 
	["英格蘭赫特福德郡"] = {},
	-- ["Humberside, England"] = {}, -- no longer
	-- ["Huntingdon and Peterborough, England"] = {}, -- no longer
	-- ["Huntingdonshire, England"] = {}, -- no longer
	-- ["the Isle of Ely, England"] = {}, -- no longer
	["英格蘭懷特島"] = {},
	["英格蘭肯特郡"] = {},
	["英格蘭蘭開夏"] = {},
	["英格蘭萊斯特郡"] = {},
	["英格蘭林肯郡"] = {},
	-- ["the County of London, England"] = {}, -- no longer
	["英格蘭默西賽德郡"] = {},
	-- ["米德爾塞克斯"] = {}, -- no longer
	["英格蘭諾福克郡"] = {},
	["英格蘭北安普敦郡"] = {},
	["英格蘭諾森伯蘭郡"] = {},
	-- ["North Humberside, England"] = {}, -- no longer
	["英格蘭北約克郡"] = {},
	["英格蘭諾丁漢郡"] = {},
	["英格蘭牛津郡"] = {},
	-- ["the Soke of Peterborough, England"] = {}, -- no longer
	["英格蘭拉特蘭郡"] = {},
	["英格蘭什羅普郡"] = {},
	["英格蘭森麻實郡"] = {},
	["英格蘭南亨伯賽德"] = {},
	["英格蘭南約克郡"] = {},
	["英格蘭斯塔福德郡"] = {},
	["英格蘭薩福克郡"] = {},
	["英格蘭薩里郡"] = {},
	-- ["薩塞克斯郡"] = {}, -- no longer
	["英格蘭泰恩-威爾郡"] = {},
	["英格蘭華威郡"] = {},
	["英格蘭西密德蘭郡"] = {},
	-- ["Westmorland, England"] = {}, -- no longer
	-- ["West Suffolk, England"] = {}, -- no longer
	["英格蘭西薩塞克斯郡"] = {},
	["英格蘭西約克郡"] = {},
	["英格蘭威爾特郡"] = {},
	["英格蘭伍斯特郡"] = {},
	-- ["約克郡"] = {}, -- no longer
	["英格蘭東約克郡"] = {},
	-- ["the North Riding of Yorkshire, England"] = {}, -- no longer
	-- ["the West Riding of Yorkshire, England"] = {}, -- no longer
}

export.northern_irish_counties = {
	["安特里姆郡"] = {},
	["阿馬郡"] = {},
	["the City of Belfast, Northern Ireland"] = {is_city = true},
	["唐郡"] = {},
	["County Fermanagh, Northern Ireland"] = {},
	["County Londonderry, Northern Ireland"] = {},
	["the City of Derry, Northern Ireland"] = {is_city = true},
	["County Tyrone, Northern Ireland"] = {},
}

export.romanian_counties = {
	["Alba County, Romania"] = {},
	["阿拉德縣"] = {},
	["Argeș County, Romania"] = {},
	["Bacău County, Romania"] = {},
	["Bihor County, Romania"] = {},
	["Bistrița-Năsăud County, Romania"] = {},
	["Botoșani County, Romania"] = {},
	["Brașov County, Romania"] = {},
	["Brăila County, Romania"] = {},
	["布澤烏縣"] = {},
	["Caraș-Severin County, Romania"] = {},
	["Cluj County, Romania"] = {},
	["Constanța County, Romania"] = {},
	["Covasna County, Romania"] = {},
	["Călărași County, Romania"] = {},
	["Dolj County, Romania"] = {},
	["Dâmbovița County, Romania"] = {},
	["Galați County, Romania"] = {},
	["Giurgiu County, Romania"] = {},
	["Gorj County, Romania"] = {},
	["Harghita County, Romania"] = {},
	["Hunedoara County, Romania"] = {},
	["Ialomița County, Romania"] = {},
	["Iași County, Romania"] = {},
	["Ilfov County, Romania"] = {},
	["Maramureș County, Romania"] = {},
	["Mehedinți County, Romania"] = {},
	["Mureș County, Romania"] = {},
	["Neamț County, Romania"] = {},
	["Olt County, Romania"] = {},
	["Prahova County, Romania"] = {},
	["薩圖馬雷縣"] = {},
	["Sibiu County, Romania"] = {},
	["蘇恰瓦縣"] = {},
	["Sălaj County, Romania"] = {},
	["Teleorman County, Romania"] = {},
	["Timiș County, Romania"] = {},
	["Tulcea County, Romania"] = {},
	["Vaslui County, Romania"] = {},
	["Vrancea County, Romania"] = {},
	["Vâlcea County, Romania"] = {},
}

export.scottish_council_areas = {
	["蘇格蘭格拉斯哥市"] = {},
	["蘇格蘭愛丁堡市"] = {},
	["蘇格蘭法夫"] = {},
	["蘇格蘭北拉納克郡"] = {},
	["蘇格蘭南拉納克郡"] = {},
	["蘇格蘭阿伯丁郡"] = {},
	["蘇格蘭高地"] = {},
	["蘇格蘭亞伯丁市"] = {},
	["蘇格蘭西洛錫安郡"] = {},
	["蘇格蘭倫弗魯郡"] = {},
	["蘇格蘭福爾柯克"] = {},
	["Perth and Kinross, Scotland"] = {},
	["Dumfries and Galloway, Scotland"] = {},
	["the City of Dundee, Scotland"] = {},
	["北艾爾郡"] = {},
	["East Ayrshire, Scotland"] = {},
	["安格斯 (蘇格蘭)"] = {},
	["the Scottish Borders, Scotland"] = {},
	["南艾爾郡"] = {},
	["East Dunbartonshire, Scotland"] = {},
	["East Lothian, Scotland"] = {},
	["慕禮"] = {},
	["East Renfrewshire, Scotland"] = {},
	["史特靈"] = {},
	["中洛錫安"] = {},
	["West Dunbartonshire, Scotland"] = {},
	["阿蓋爾和比特"] = {},
	["Inverclyde, Scotland"] = {},
	["Clackmannanshire, Scotland"] = {},
	["Na h-Eileanan Siar, Scotland"] = {},
	["蘇格蘭昔得蘭群島"] = {},
	["蘇格蘭奧克尼群島"] = {},
}

export.welsh_principal_areas = {
	["Blaenau Gwent, Wales"] = {},
	["布里真德市"] = {},
	["卡菲利自治市"] = {},
	-- ["加的夫"] = {divtype = "city"},
	["卡馬森郡"] = {divtype = "county"},
	["錫爾迪金"] = {divtype = "county"},
	["Conwy, Wales"] = {},
	["登比郡"] = {divtype = "county"},
	["弗林特郡"] = {divtype = "county"},
	["格溫內斯"] = {divtype = "county"},
	["the Isle of Anglesey, Wales"] = {divtype = "county"},
	["梅瑟蒂德菲爾"] = {},
	["蒙茅斯郡"] = {divtype = "county"},
	["下塔爾波特港"] = {},
	-- ["紐波特"] = {divtype = "city"},
	["彭布羅克郡"] = {divtype = "county"},
	["波伊斯"] = {divtype = "county"},
	["朗達卡嫩塔夫"] = {},
	-- ["斯旺西"] = {divtype = "city"},
	["Torfaen, Wales"] = {},
	["the Vale of Glamorgan, Wales"] = {},
	["雷克斯漢姆"] = {},
}

export.new_york_boroughs = {
	["布朗克斯"] = true,
	["布魯克林區"] = true,
	["曼哈頓"] = true,
	["皇后區"] = true,
	["史泰登島"] = true,
}

export.cities = {
	{
		default_divtype = "state",
		containing_polities = {"巴西", divtype="country"},
		data = {
			-- This only lists cities, not metro areas, over 1,000,000 inhabitants.
			["聖保羅"] = {"聖保羅"},
			["里約熱內盧"] = {"里約熱內盧"},
			["巴西利亞"] = {"聯邦區"},
			["薩爾瓦多"] = {"巴伊亞州"},
			["福塔萊薩"] = {"塞阿拉州"},
			["貝洛奧里藏特"] = {"米納斯吉拉斯州"},
			["馬瑙斯"] = {"亞馬孫州"},
			["庫里奇巴"] = {"巴拉那州"},
			["累西腓"] = {"伯南布哥州"},
			["戈亞尼亞"] = {"戈亞斯州"},
			["貝倫"] = {"帕拉州"},
			["阿雷格里港"] = {"南里約格朗德州"},
			["瓜魯柳斯"] = {"聖保羅"},
			["坎皮納斯"] = {"聖保羅"},
		},
	},
	{
		default_divtype = "省",
		containing_polities = {"加拿大", divtype="國家"},
		data = {
			["多倫多"] = {"安大略省"},
			["蒙特婁"] = {"魁北克省"},
			["溫哥華"] = {"不列顛哥倫比亞省"},
			["卡爾加里"] = {"艾伯塔省"},
			["埃德蒙頓"] = {"艾伯塔省"},
			["渥太華"] = {"安大略省"},
			["溫尼伯"] = {"曼尼托巴省"},
			["魁北克市"] = {"魁北克省"},
			["漢密爾頓"] = {"安大略省"},
			["基秦拿"] = {"安大略省"},
		},
	},
	{
		default_divtype = "省",
		containing_polities = {"中國", divtype="國家"},
		data = {
			-- This only lists the top 50. Per ["w:List of cities in China by population"], there
			-- are 102 cities over 1,000,000 inhabitants, not to mention metro areas. Our coverage
			-- of China is fairly sparse; when it increases, add to this list.
			["上海"] = {},
			["北京"] = {},
			["廣州"] = {"廣東"},
			["深圳"] = {"廣東"},
			["天津"] = {},
			["武漢"] = {"湖北"},
			["東莞"] = {"廣東"},
			["成都"] = {"四川"},
			["佛山"] = {"廣東"},
			["重慶"] = {},
			["南京"] = {"江蘇"},
			["瀋陽"] = {"遼寧"},
			["杭州"] = {"浙江"},
			["西安"] = {"陝西"},
			["哈爾濱"] = {"黑龍江"},
			["蘇州"] = {"江蘇"},
			["青島"] = {"山東"},
			["大連"] = {"遼寧"},
			["鄭州"] = {"河南"},
			["汕頭"] = {"廣東"},
			["濟南"] = {"山東"},
			["長春"] = {"吉林"},
			["昆明"] = {"雲南"},
			["長沙"] = {"湖南"},
			["太原"] = {"山西"},
			["廈門"] = {"福建"},
			["合肥"] = {"安徽"},
			["石家莊"] = {"河北"},
			["烏魯木齊"] = {"新疆", divtype="自治區"},
			["福州"] = {"福建"},
			["無錫"] = {"江蘇"},
			["中山"] = {"廣東"},
			["溫州"] = {"浙江"},
			["南寧"] = {"廣西", divtype="自治區"},
			["南昌"] = {"江西"},
			["寧波"] = {"浙江"},
			["貴陽"] = {"貴州"},
			["蘭州"] = {"甘肅"},
			["淄博"] = {"山東"},
			["常州"] = {"江蘇"},
			["徐州"] = {"江蘇"},
			["唐山"] = {"河北"},
			["包頭"] = {"內蒙古", divtype="自治區"},
			["惠州"] = {"廣東"},
			["煙臺"] = {"山東"},
			["紹興"] = {"浙江"},
			["柳州"] = {"廣西", divtype="自治區"},
			["南通"] = {"江蘇"},
			["洛陽"] = {"河南"},
			["揚州"] = {"江蘇"},
		},
	},
	{
		default_divtype = "region",
		containing_polities = {"法國", divtype="country"},
		data = {
			["巴黎"] = {"法蘭西島"},
			["里昂"] = {"奧弗涅-羅訥-阿爾卑斯"},
			["馬賽"] = {"普羅旺斯-阿爾卑斯-藍色海岸"},
			["土魯斯"] = {"奧克西塔尼"},
			["里爾"] = {"上法蘭西"},
			["波爾多"] = {"新阿基坦"},
			["尼斯"] = {"普羅旺斯-阿爾卑斯-藍色海岸"},
			["南特"] = {"羅亞爾河地區"},
			["斯特拉斯堡"] = {"大東部"},
			["雷恩"] = {"布列塔尼"},
		},
	},
	{
		default_divtype = "state",
		containing_polities = {"德國", divtype="country"},
		data = {
			["柏林"] = {},
			["多特蒙德"] = {"北萊茵-威斯伐倫"},
			["埃森"] = {"北萊茵-威斯伐倫"},
			["杜伊斯堡"] = {"北萊茵-威斯伐倫"},
			["漢堡"] = {},
			["慕尼黑"] = {"巴伐利亞"},
			["斯圖加特"] = {"巴登-符騰堡"},
			["美因河畔法蘭克福"] = {"黑森"},
			["科隆"] = {"北萊茵-威斯伐倫"},
			["杜塞道夫"] = {"北萊茵-威斯伐倫"},
			["紐倫堡"] = {"巴伐利亞"},
			["不萊梅"] = {},
		},
	},
	{
		default_divtype = "state",
		containing_polities = {"印度", divtype="country"},
		data = {
			-- This only lists the top 20. Per ["w:List of cities in India by population"], there
			-- are 46 cities over 1,000,000 inhabitants, not to mention metro areas. Our coverage
			-- of India is fairly sparse; when it increases, add to this list.
			["孟買"] = {"馬哈拉施特拉邦"},
			["德里"] = {},
			["班加羅爾"] = {"卡納塔卡邦"},
			["海得拉巴"] = {"泰倫加納邦"},
			["艾哈邁達巴德"] = {"古吉拉特邦"},
			["金奈"] = {"泰米爾納德邦"},
			["加爾各答"] = {"西孟加拉邦"},
			["蘇拉特"] = {"古吉拉特邦"},
			["浦那"] = {"馬哈拉施特拉邦"},
			["齋浦爾"] = {"拉賈斯坦邦"},
			["勒克瑙"] = {"北方邦"},
			["坎普爾"] = {"北方邦"},
			["那格浦爾"] = {"馬哈拉施特拉邦"},
			["印多爾"] = {"中央邦"},
			["塔那"] = {"馬哈拉施特拉邦"},
			["博帕爾"] = {"中央邦"},
			["維沙卡帕特南"] = {"安得拉邦"},
			["賓布里金傑沃德"] = {"馬哈拉施特拉邦"},
			["巴特那"] = {"比哈爾邦"},
			["巴羅達"] = {"古吉拉特邦"},
		},
	},
	{
		default_divtype = "都道府縣",
		containing_polities = {"日本", divtype="國家"},
		data = {
			-- Population figures from ["w:List of cities in Japan"]. Metro areas from
			-- ["w:List of metropolitan areas in Japan"].
			["東京都"] = {}, -- no single figure given for Tokyo as a whole.
			["橫濱"] = {"神奈川"}, -- 3,697,894
			["大阪"] = {"大阪"}, -- 2,668,586
			["名古屋"] = {"愛知"}, -- 2,283,289
			-- FIXME, Hokkaido is handled specially.
			["札幌"] = {}, -- {"Hokkaido"}, -- 1,918,096
			["福岡"] = {"福岡"}, -- 1,581,527
			["神戶"] = {"兵庫"}, -- 1,530,847
			["京都"] = {"京都"}, -- 1,474,570
			["川崎"] = {"神奈川"}, -- 1,373,630
			["埼玉"] = {"埼玉"}, -- 1,192,418
			["廣島"] = {"廣島"}, -- 1,163,806
			["仙台"] = {"宮城"}, -- 1,029,552
			-- the remaining cities are considered "central cities" in a 1,000,000+ metro area
			-- (sometimes there is more than one central city in the area).
			["北九州"] = {"福岡"}, -- 986,998
			["千葉"] = {"千葉"}, -- 938,695
			["堺市"] = {"大阪"}, -- 835,333
			["新潟"] = {"新潟"}, -- 813,053
			["濱松"] = {"靜岡"}, -- 811,431
			["靜岡"] = {"靜岡"}, -- 710,944
			["相模原"] = {"神奈川"}, -- 706,342
			["岡山"] = {"岡山"}, -- 701,293
			["熊本"] = {"熊本"}, -- 670,348
			["鹿兒島"] = {"鹿兒島"}, -- 605,196
			-- skipped 6 cities (Funabashi, Hachiōji, Kawaguchi, Himeji, Matsuyama, Higashiōsaka)
			-- with population in the range 509k - 587k because not central cities in any
			-- 1,000,000+ metro area.
			["宇都宮"] = {"栃木"}, -- 507,833
		},
	},
	{
		default_divtype = "oblast",
		containing_polities = {"俄羅斯", divtype="country"},
		data = {
			-- This only lists cities, not metro areas, over 1,000,000 inhabitants.
			["莫斯科"] = {},
			["聖彼得堡"] = {},
			["新西伯利亞"] = {"新西伯利亞州"},
			["葉卡捷琳堡"] = {"斯維爾德洛夫斯克州"},
			["下諾夫哥羅德"] = {"下諾夫哥羅德州"},
			["喀山"] = {"韃靼斯坦共和國", divtype="republic"},
			["車里雅賓斯克"] = {"車里雅賓斯克州"},
			["鄂木斯克"] = {"鄂木斯克州"},
			["薩馬拉"] = {"薩馬拉州"},
			["烏法"] = {"巴什科爾托斯坦共和國", divtype="republic"},
			["頓河畔羅斯托夫"] = {"羅斯托夫州"},
			["克拉斯諾亞爾斯克"] = {"克拉斯諾亞爾斯克邊疆區", divtype="krai"},
			["沃羅涅日"] = {"沃羅涅日州"},
			["彼爾姆"] = {"彼爾姆邊疆區", divtype="krai"},
			["伏爾加格勒"] = {"伏爾加格勒州"},
			["克拉斯諾達爾"] = {"克拉斯諾達爾邊疆區", divtype="krai"},
		},
	},
	{
		default_divtype = "自治區",
		containing_polities = {"西班牙", divtype="國家"},
		data = {
			["馬德里"] = {"馬德里自治區"},
			["巴塞隆納"] = {"加泰隆尼亞"},
			-- this causes recursion errors.
			-- ["瓦倫西亞"] = {"Valencia"},
			["塞維亞"] = {"安達盧西亞"},
			["畢爾巴鄂"] = {"巴斯克地區"},
		},
	},
	{
		default_divtype = "county",
		containing_polities = {"英國", divtype="country"},
		data = {
			["倫敦"] = {{"大倫敦"}, {"英格蘭", divtype="constituent country"}},
			["曼徹斯特"] = {{"大曼徹斯特郡"}, {"英格蘭", divtype="constituent country"}},
			["伯明罕"] = {{"西密德蘭郡"}, {"英格蘭", divtype="constituent country"}},
			["利物浦"] = {{"默西賽德郡"}, {"英格蘭", divtype="constituent country"}},
			["格拉斯哥"] = {{"格拉斯哥市", divtype="council area"}, {"Scotland", divtype="constituent country"}},
			["利茲"] = {{"西約克郡"}, {"英格蘭", divtype="constituent country"}},
			["泰恩河畔紐卡斯爾"] = {{"泰恩-威爾郡"}, {"英格蘭", divtype="constituent country"}},
			["紐卡斯爾"] = {alias_of="泰恩河畔紐卡斯爾"},
			["布里斯托"] = {{"英格蘭", divtype="constituent country"}},
			["加的夫"] = {{"威爾士", divtype="constituent country"}},
			["樸茨茅斯"] = {{"漢普郡"}, {"英格蘭", divtype="constituent country"}},
			["愛丁堡"] = {{"愛丁堡市", divtype="council area"}, {"Scotland", divtype="constituent country"}},
			-- under 1,000,000 people but principal areas of Wales; requested by ["User:Donnanz"]
			["斯旺西"] = {{"威爾士", divtype="constituent country"}},
			["紐波特"] = {{"威爾士", divtype="constituent country"}},
		},
	},
	-- cities in the US
	{
		default_divtype = "state",
		containing_polities = {"美國", divtype="country"},
		data = {
			-- top 50 CSA's by population, with the top and sometimes 2nd or 3rd city listed
			["紐約"] = {"紐約州"},
			["紐華克"] = {"新澤西州"},
			["洛杉磯"] = {"加利福尼亞州"},
			["長灘"] = {"加利福尼亞州"},
			["里弗賽德"] = {"加利福尼亞州"},
			["芝加哥"] = {"伊利諾州"},
			["華盛頓哥倫比亞特區"] = {},
			["巴爾的摩"] = {"馬里蘭州"},
			["聖何塞"] = {"加利福尼亞州"},
			["舊金山"] = {"加利福尼亞州"},
			["奧克蘭"] = {"加利福尼亞州"},
			["波士頓"] = {"麻薩諸塞州"},
			["普羅維登斯"] = {"羅德島"},
			["達拉斯"] = {"德克薩斯州"},
			["沃斯堡"] = {"德克薩斯州"},
			["費城"] = {"賓夕法尼亞州"},
			["休斯敦"] = {"德克薩斯州"},
			["邁阿密"] = {"佛羅里達州"},
			["亞特蘭大"] = {"喬治亞州"},
			["底特律"] = {"密西根州"},
			["菲尼克斯"] = {"亞利桑那州"},
			["平頂山"] = {"亞利桑那州"},
			["西雅圖"] = {"華盛頓州"},
			["奧蘭多"] = {"佛羅里達州"},
			["明尼阿波利斯"] = {"明尼蘇達州"},
			["克利夫蘭"] = {"俄亥俄州"},
			["丹佛"] = {"科羅拉多州"},
			["聖地牙哥"] = {"加利福尼亞州"},
			["波特蘭"] = {"奧勒岡州"},
			["坦帕"] = {"佛羅里達州"},
			["聖路易斯"] = {"密蘇里州"},
			["夏洛特"] = {"北卡羅萊納州"},
			["沙加緬度"] = {"加利福尼亞州"},
			["匹茲堡"] = {"賓夕法尼亞州"},
			["鹽湖城"] = {"猶他州"},
			["聖安東尼奧"] = {"德克薩斯州"},
			["哥倫布"] = {"俄亥俄州"},
			["堪薩斯城"] = {"密蘇里州"},
			["印第安納波利斯"] = {"印第安納州"},
			["拉斯維加斯"] = {"內華達州"},
			["辛辛那提"] = {"俄亥俄州"},
			["奧斯汀"] = {"德克薩斯州"},
			["密爾沃基"] = {"威斯康辛州"},
			["羅利"] = {"北卡羅萊納州"},
			["納什維爾"] = {"田納西州"},
			["維珍尼亞海灘"] = {"維吉尼亞州"},
			["諾福克郡"] = {"維吉尼亞州"},
			["格林斯伯勒"] = {"北卡羅萊納州"},
			["溫斯頓-撒冷"] = {"北卡羅萊納州"},
			["傑克遜維爾"] = {"佛羅里達州"},
			["紐奧良"] = {"路易斯安那州"},
			["路易維爾"] = {"肯塔基州"},
			["格林維爾"] = {"南卡羅萊納州"},
			["哈特福"] = {"康乃狄克州"},
			["俄克拉荷馬市"] = {"奧克拉荷馬州"},
			["大急流城"] = {"密西根州"},
			["孟斐斯"] = {"田納西州"},
			["伯明罕"] = {"阿拉巴馬州"},
			["弗雷斯諾"] = {"加利福尼亞州"},
			["里奇蒙"] = {"維吉尼亞州"},
			["哈里斯堡"] = {"賓夕法尼亞州"},
			-- any major city of top 50 MSA's that's missed by previous
			["布法羅"] = {"紐約州"},
			-- any of the top 50 city by city population that's missed by previous
			["艾爾帕索"] = {"德克薩斯州"},
			["阿布奎基"] = {"新墨西哥州"},
			["圖森"] = {"亞利桑那州"},
			["科羅拉多斯普林斯"] = {"科羅拉多州"},
			["奧馬哈"] = {"內布拉斯加州"},
			["塔爾薩"] = {"奧克拉荷馬州"},
			-- skip Arlington, Texas; too obscure and likely to be interpreted as Arlington, Virginia
		}
	},
	{
		default_divtype = "country",
		containing_polities = {},
		data = {
			["維也納"] = {"奧地利"},
			["明斯克"] = {"白俄羅斯"},
			["布魯塞爾-首都大區"] = {"比利時"},
			["安特衛普"] = {"比利時"},
			["索菲亞"] = {"保加利亞"},
			["薩格勒布"] = {"克羅地亞"},
			["布拉格"] = {"捷克"},
			["哥本哈根"] = {"丹麥"},
			["赫爾辛基"] = {{"新地區", divtype="region"}, {"芬蘭"}},
			["雅典"] = {"希臘"},
			["塞薩洛尼基"] = {"希臘"},
			["布達佩斯"] = {"匈牙利"},
			-- FIXME, per Wikipedia "County Dublin" is now the "Dublin Region"
			["都柏林"] = {{"都柏林", divtype="county"}, {"愛爾蘭"}},
			["羅馬"] = {{"拉齊奧大區", divtype="region"}, {"意大利"}},
			["米蘭"] = {{"倫巴第大區", divtype="region"}, {"意大利"}},
			["那不勒斯"] = {{"坎帕尼亞大區", divtype="region"}, {"意大利"}},
			["都靈"] = {{"皮埃蒙特大區", divtype="region"}, {"意大利"}},
			["里加"] = {"拉脫維亞"},
			["阿姆斯特丹"] = {"荷蘭"},
			["鹿特丹"] = {"荷蘭"},
			["海牙"] = {"荷蘭"},
			["奧斯陸"] = {"挪威"},
			["華沙"] = {"波蘭"},
			["卡托維茲"] = {"波蘭"},
			["克拉科夫"] = {"波蘭"},
			["格但斯克"] = {"波蘭"},
			["波茲南"] = {"波蘭"},
			["羅茲"] = {"波蘭"},
			["里斯本"] = {"葡萄牙"},
			["波爾圖"] = {"葡萄牙"},
			["布加勒斯特"] = {"羅馬尼亞"},
			["貝爾格勒"] = {"塞爾維亞"},
			["斯德哥爾摩"] = {"瑞典"},
			["蘇黎世"] = {"瑞士"},
			["伊斯坦堡"] = {"土耳其"},
			["基輔"] = {"烏克蘭"},
			["哈爾科夫"] = {"烏克蘭"},
			["敖德薩"] = {"烏克蘭"},
		},
	},
}

-----------------------------------------------------------------------------------
--                              Helper functions                                 --
-----------------------------------------------------------------------------------

local function ucfirst(label)
	return mw.getContentLanguage():ucfirst(label)
end

local function add_indefinite_article(label)
	if label:find("^[aeiouAEIOU]") then
		return "an " .. label
	else
		return "a " .. label
	end
end

function export.construct_bare_and_linked_version(key)
	local bare_key = key:match("^the (.*)$")
	local linked_key
	if bare_key then
		linked_key = "the [[" .. bare_key .. "]]"
	else
		linked_key = "[[" .. key .. "]]"
		bare_key = key
	end
	return bare_key, linked_key
end

local function simple_polity_bare_label_setter()
	return function(labels, group, key, value)
		local bare_key, linked_key = export.construct_bare_and_linked_version(key)
		local keydesc = value.keydesc or linked_key
		labels[bare_key] = {
			description = value.bare_label_desc or "與" .. keydesc .. "人民、文化或領土相關的{{{langname}}}詞語。",
			parents = value.parents,
		}
	end
end

local function subpolity_keydesc(key, value, containing_polity, default_divtype)
	local divtype = value.divtype or default_divtype
	divtype = type(divtype) == "table" and divtype[1] or divtype
	divtype = add_indefinite_article(divtype)
	local bare_key, linked_key = export.construct_bare_and_linked_version(key)
	local bare_containing_polity, linked_containing_polity = export.construct_bare_and_linked_version(containing_polity)
	return value.keydesc or linked_key .. ", " .. divtype .. " of " .. linked_containing_polity
end

local function apply_key_to_placename(key, key_to_placename)
	local placename = key
	if key_to_placename then
		placename = key_to_placename(key)
		if type(placename) == "table" then
			placename = placename[1]
		end
	end
	return placename
end

local function subpolity_bare_label_setter(containing_polity)
	return function(labels, group, key, value)
		local placename = apply_key_to_placename(key, group.key_to_placename)
		local keydesc = subpolity_keydesc(placename, value, containing_polity, group.default_divtype)
		local bare_key, linked_key = export.construct_bare_and_linked_version(key)
		local bare_containing_polity, linked_containing_polity = export.construct_bare_and_linked_version(containing_polity)
		labels[bare_key] = {
			description = value.bare_label_desc or "與" .. keydesc .. "人民、文化或領土相關的{{{langname}}}詞語。",
			parents = value.parents or {bare_containing_polity},
		}
	end
end

local function subpolity_value_transformer(containing_polity)
	local containing_polity_type = "country"
	if type(containing_polity) == "table" then
		containing_polity_type, containing_polity = containing_polity[1], containing_polity[2]
	end
	return function(group, key, value)
		local placename = apply_key_to_placename(key, group.key_to_placename)
		value.keydesc = subpolity_keydesc(placename, value, containing_polity, group.default_divtype)
		value.containing_polity = containing_polity
		value.containing_polity_type = containing_polity_type
		value.poldiv = value.poldiv or group.default_poldiv
		value.british_spelling = value.british_spelling or group.british_spelling
		return value
	end
end

local function default_place_cat_handler()
	return function(group, placetype, holonym_placetype, holonym_placename)
		if group.placename_to_key then
			holonym_placename = group.placename_to_key(holonym_placename)
		end
		local spec = group.data[holonym_placename]
		if not spec then
			holonym_placename = "the " .. holonym_placename
			spec = group.data[holonym_placename]
		end
		if not spec then
			return nil
		end
		local divtype = spec.divtype or group.default_divtype
		if type(divtype) == "table" then
			for _, dt in ipairs(divtype) do
				if dt == holonym_placetype then
					return holonym_placename
				end
			end
			return nil
		else
			return divtype == holonym_placetype and holonym_placename or nil
		end
	end
end

-- This is typically used to define key_to_placename. It generates a function that chops off
-- part of a string using the regex TO_CHOP. To chop at the end, add $ at the end of the regex;
-- to chop at the beginning, add ^ at the beginning. It is normally used for subpolities (e.g.
-- states of the US or counties of England) when the placename of the polity as found in
-- categories includes the larger containing polity in it (e.g. "Georgia, USA" or
-- "Hampshire, England"). Typical usage is like this:
--
-- ...
-- key_to_placename = chop(", England$"),
-- ...
local function chop(to_chop)
	return function(key) return key:gsub(to_chop, "") end
end

-- This is typically used to define placename_to_key. It generates a function that appends a
-- string to the end of a given string. It does the opposite operation of chop() and is used
-- along with that function. It is normally used for subpolities (e.g. states of the US or
-- counties of England) when the placename of the polity as found in categories includes the
-- larger containing polity in it (e.g. "Georgia, USA" or "Hampshire, England"). Typical usage
-- is like this:
--
-- ...
-- placename_to_key = append(", England"),
-- ...
local function append(to_append)
	return function(placename) return to_append .. placename end
end

local function construct_russian_federal_subject_keydesc(linked_key, divtype)
	if divtype == "oblast" then
		-- Hack: Oblasts generally don't have entries under "Foo Oblast"
		-- but just under "Foo", so fix the linked key appropriately;
		-- doesn't apply to the Jewish Autonomous Oblast
		linked_key = linked_key:gsub(" Oblast%]%]", "%]%] Oblast")
	end
	return linked_key .. ", a federal subject ([[" .. divtype .. "]]) of [[Russia]]"
end

local function northern_ireland_key_to_placename(key)
	key = key:gsub(", Northern Ireland$", "")
	local bare_key = key:gsub("^County ", "")
	if key == bare_key then
		return key
	else
		return {key, bare_key}
	end
end

local function northern_ireland_placename_to_key(placename)
	if not placename:find("^County ") and not placename:find("^City ") then
		placename = "County " .. placename
	end
	return placename .. ", Northern Ireland"
end

local function ireland_key_to_placename(key)
	key = key:gsub("^愛爾蘭", "")
	local bare_key = key:gsub("郡$", "")
	if key == bare_key then
		return key
	else
		return {key, bare_key}
	end
end

local function ireland_placename_to_key(placename)
	if not placename:find("^郡$") and not placename:find("^City ") then
		placename = placename .. "郡"
	end
	return "愛爾蘭" .. placename
end

function export.get_city_containing_polities(group, key, value)
	local containing_polities = group.containing_polities
	if type(containing_polities[1]) == "string" then
		containing_polities = {containing_polities}
	elseif value[1] then
		containing_polities = m_table.shallowcopy(containing_polities)
	end
	local this_containing_polities = value
	if type(value[1]) == "string" then
		this_containing_polities = {this_containing_polities}
	end
	for n, polity in ipairs(this_containing_polities) do
		table.insert(containing_polities, n, polity)
	end
	return containing_polities
end

-- Given a containing polity of a city, possibly with preceding "the" removed,
-- find the group and key in 'export.polities'.
function export.city_containing_polity_to_group_and_key(polity)
	for _, polity_group in ipairs(export.polities) do
		local key_polity = polity
		if polity_group.placename_to_key then
			key_polity = polity_group.placename_to_key(key_polity)
		end
		if polity_group.data[key_polity] then
			return polity_group, key_polity
		end
		key_polity = "the " .. key_polity
		if polity_group.data[key_polity] then
			return polity_group, key_polity
		end
	end
	return nil
end

-----------------------------------------------------------------------------------
--                                  Polities                                     --
-----------------------------------------------------------------------------------

--[=[

The following table consists of one or more groups, each of which contains several
items (places) that are handled similarly. Each group contains a list of all the places
contained in that group along with their properties, as well as group-specific handlers that
specify common properties of all items in the group. These items are used to construct labels
for the following types of categories:

1. A bare label category, e.g. 'en:Netherlands'. Labels for these are created by the
   'bare_label_setter' handler of a given group.
2. Normally, several categories of the form 'fr:Cities in the Netherlands',
   'es:Rivers in New Mexico, USA', etc., for the place types listed above in 'generic_place_types'.
   There is a top-level handler that will automatically create labels for such categories.
   It can be disabled for all place types in 'generic_place_types' that aren't in
   'generic_place_types_for_cities' by specifying 'is_city = true' in the data for a given item.
   (This is used for city-states such as Monaco and Vatican City.) It can also be disabled for all
   place types in 'generic_place_types' other than "places" by specifying 'is_former_place = true'
   in the data for a given item. (The group below for former countries and empires has a handler
   that specifies 'is_former_place = true' for all items in the group. The reason for this is that
   former states such as Persia, East Germany, the Soviet Union and the Roman Empire should have
   their cities, towns, rivers and such listed under the current entities occupying the same area.)
3. Optionally, one or more categories of the form 'de:Provinces of the Netherlands',
   'pt:Counties of Wales', etc. These are for political subdivisions, and for historic/popular
   subdivisions that have no current political significance (e.g. 'nl:Provinces of Ireland',
   'zh:Regions of the United States'). These are controlled by the 'poldiv' (for political
   subdivisions) and 'miscdiv' (for historic/popular subdivisions) keys in the data for a
   given item.

NOTE: Second-level political subdivisions (e.g. counties of states of the US) could be handled
here but normally aren't. Instead, there are special handlers below for US counties and
Brazilian and Philippine municipalities, and manually-created labels for certain other countries
(e.g. Canadian counties). The reason for this is that all political and historic/popular subdivisions
handled here have a category like "en:Political subdivisions" as their primary parent, whereas
we often want a different primary parent for second-level political subdivisions, such as
"en:Counties of the United States" for US counties. FIXME: We should allow the parents
to be specified for political subdivisions. This will probably necessitate another type of
group-specific handler, similar to 'value_transformer' and 'bare_label_setter' (see below).

NOTE: Some of the above categories are added automatically to pages that use the {{place}}
template with the appropriate values. Currently, whether or not such categories are added
is controlled by [[Module:place/data]], which is independent of the data here but in many
ways duplicates it. FIXME: The two should be merged.

NOTE: There is also some duplication in [[Module:category tree/topic cat/data/Earth]],
particularly for continents and supranational regions (e.g. "the British Isles").
FIXME: Consolidate the data there into here.

Each group consists of a table with the following keys:

   * 'data': This is a table listing the polities in the group. The keys are polities in the form
	 that they appear in a category like 'de:Provinces of the Netherlands' or 'fr:Cities in Alabama, USA'
	 (hence, they should include prefixes such as "the" and suffixes such as ", USA"). The value of a
	 key is a property table. Its format is described above under "Placename Tables". Note that the
	 property table is transformed using the group's 'value_transformer' handler before being used.

   * 'value_transformer': This function is used to transform the value of an item in 'data'
	 (an object containing properties of a place; see above) to the final form used by the handlers
	 in [[Module:category tree/topic cat/data/Places]] that handle city-type and
	 political-subdivision-type categories. It is passed three arguments (the group and the key and
	 value of the data item). Its normal purpose is to add extra properties to the data item value,
	 such as 'containing_polity' (see above) and 'keydesc' (the appropriate description of the place,
	 which often includes the type of division and the country).  Some groups (in particular,
	 the one for former polities, such as Persia and the Roman Empire) also add 'is_former_place = true'.
	 The reason these extra properties are added by a function like this instead of included directly
	 is that they are typically the same or similar for all items in a group, and including them
	 directly would be duplicative. Note that there is a preconstructed function
	 subpolity_bare_label_setter() (for subpolities of top-level polities) to help.

   * 'bare_label_setter': This function adds an entry in the 'labels' table for bare label
	 categories such as 'en:Netherlands', 'fr:Alabama, USA' or 'ru:Republic of Tatarstan'.
	 It is passed four arguments (the 'labels' table, the group and the key and value of the
	 data item). There are preconstructed functions to help here, such as
	 simple_polity_bare_label_setter() (for top-level polities) and subpolity_bare_label_setter()
	 (for subpolities of top-level polities). This function often makes use of the 'parents'
	 and/or 'description' keys in the data item's value (see above).

   * 'place_cat_handler': Used in conjunction with {{place}} to properly categorize placenames.
	 Given four arguments (GROUP, the spec for a given group; PLACENAME, the placename for
	 a given place; HOLONYM_PLACETYPE, the placetype of a holonym of a place [e.g. "country" for
	 a location in a country]; and HOLONYM_PLACENAME, the name of a holonym of a place [e.g.
	 "法國" for a location in France]), return the key in DATA correponding to HOLONYM_PLACENAME,
	 but only if the placetype of that key matches HOLONYM_PLACETYPE.

   * 'default_divtype': The default entity type for entities in this group, if not overidden at the
	 entity level. See 'divtype' above under "Placename Tables".
]=]

export.polities = {
	-- countries
	{
		bare_label_setter = simple_polity_bare_label_setter(),
		value_transformer = function(group, key, value)
			value.british_spelling = value.british_spelling or group.british_spelling
			return value
		end,
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "country",
		data = export.countries,
	},

	-- pseudo-countries: typically overseas territories or de-facto independent countries, which in both cases
	-- are not internationally recognized as sovereign nations but which we treat similarly to countries.
	{
		bare_label_setter = simple_polity_bare_label_setter(),
		value_transformer = function(group, key, value)
			value.british_spelling = value.british_spelling or group.british_spelling
			return value
		end,
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "country",
		data = export.pseudo_countries,
	},

	-- former countries and such; we don't create "Cities in ..." categories because they don't exist anymore
	{
		bare_label_setter = simple_polity_bare_label_setter(),
		value_transformer = function(group, key, value)
			value.british_spelling = value.british_spelling or group.british_spelling
			value.is_former_place = true
			return value
		end,
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "country",
		data = export.former_countries,
	},

	-- states and territories of Australia
	{
		bare_label_setter = subpolity_bare_label_setter("澳大利亞"),
		value_transformer = subpolity_value_transformer("澳大利亞"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		british_spelling = true,
		data = export.australian_states_and_territories,
	},

	-- states of Austria
	{
		bare_label_setter = subpolity_bare_label_setter("Austria"),
		value_transformer = subpolity_value_transformer("Austria"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		british_spelling = true,
		default_poldiv = {{"municipalities", parent="municipalities of Austria"}},
		data = export.austrian_states,
	},

	-- states of Brazil
	{
		key_to_placename = chop("^巴西"),
		placename_to_key = append("巴西"),
		bare_label_setter = subpolity_bare_label_setter("巴西"),
		value_transformer = subpolity_value_transformer("巴西"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		default_poldiv = {{"municipalities", parent="municipalities of Brazil"}},
		data = export.brazilian_states,
	},

	-- provinces and territories of Canada
	{
		bare_label_setter = subpolity_bare_label_setter("Canada"),
		value_transformer = subpolity_value_transformer("Canada"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "province",
		british_spelling = true,
		data = export.canadian_provinces_and_territories,
	},

	-- provinces and autonomous regions of China
	{
		bare_label_setter = subpolity_bare_label_setter("中國"),
		value_transformer = subpolity_value_transformer("中國"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "province",
		data = export.chinese_provinces_and_autonomous_regions,
	},

	-- regions of Finland
	{
		key_to_placename = chop("^芬蘭"),
		placename_to_key = append("芬蘭"),
		bare_label_setter = subpolity_bare_label_setter("芬蘭"),
		value_transformer = subpolity_value_transformer("芬蘭"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "region",
		default_poldiv = {{"municipalities", parent="municipalities of Finland"}},
		british_spelling = true,
		data = export.finnish_regions,
	},

	-- regions of France
	{
		bare_label_setter = subpolity_bare_label_setter("法國"),
		value_transformer = subpolity_value_transformer("法國"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "region",
		british_spelling = true,
		data = export.french_regions,
	},

	-- states of Germany
	{
		bare_label_setter = subpolity_bare_label_setter("Germany"),
		value_transformer = subpolity_value_transformer("Germany"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		british_spelling = true,
		data = export.german_states,
	},

	-- states and union territories of India
	{
		bare_label_setter = subpolity_bare_label_setter("India"),
		value_transformer = subpolity_value_transformer("India"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		british_spelling = true,
		data = export.indian_states_and_union_territories,
	},

	-- provinces of Indonesia
	{
		bare_label_setter = subpolity_bare_label_setter("Indonesia"),
		value_transformer = subpolity_value_transformer("Indonesia"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "province",
		british_spelling = true,
		data = export.indonesian_provinces,
	},

	-- counties of Ireland
	{
		key_to_placename = ireland_key_to_placename,
		placename_to_key = ireland_placename_to_key,
		bare_label_setter = subpolity_bare_label_setter("Ireland"),
		value_transformer = subpolity_value_transformer("Ireland"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county",
		british_spelling = true,
		data = export.irish_counties,
	},

	-- regions of Italy
	{
		bare_label_setter = subpolity_bare_label_setter("Italy"),
		value_transformer = subpolity_value_transformer("Italy"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "region",
		british_spelling = true,
		data = export.italian_regions,
	},

	-- prefectures of Japan
	{
		key_to_placename = chop("都道府縣$"),
		placename_to_key = japanese_placename_to_key,
		-- We can't use the normal subpolity_bare_label_setter() because we set a special parent
		-- (normally the parent would just be "Japan"). FIXME: Do we want this difference?
		-- Or do we want e.g. provinces in China to have a parent "Provinces of China" instead of
		-- just "中國"?
		bare_label_setter = function(labels, group, key, value)
			labels[key] = {
				description = "{{{langname}}} terms related to [[" .. key:gsub(" Prefecture$", "") .. "]], a [[prefecture]] of [[Japan]].",
				parents = {"日本都道府縣$"},
			}
		end,
		value_transformer = subpolity_value_transformer("日本"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "prefecture",
		data = export.japanese_prefectures,
	},

	-- regions of Malta
	{
		key_to_placename = chop(", Malta$"),
		placename_to_key = append(", Malta"),
		bare_label_setter = subpolity_bare_label_setter("Malta"),
		value_transformer = subpolity_value_transformer("Malta"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "region",
		british_spelling = true,
		data = export.maltese_regions,
	},


	-- Mexican states
	{
		bare_label_setter = subpolity_bare_label_setter("Mexico"),
		value_transformer = subpolity_value_transformer("Mexico"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		data = export.mexican_states,
	},

	-- regions of Morocco
	{
		bare_label_setter = subpolity_bare_label_setter("Morocco"),
		value_transformer = subpolity_value_transformer("Morocco"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "region",
		british_spelling = true,
		data = export.moroccan_regions,
	},

	-- provinces of the Netherlands
	{
		key_to_placename = chop(", Netherlands$"),
		placename_to_key = append(", Netherlands"),
		bare_label_setter = subpolity_bare_label_setter("the Netherlands"),
		value_transformer = subpolity_value_transformer("the Netherlands"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "province",
		default_poldiv = {{"municipalities", parent="municipalities of the Netherlands"}},
		british_spelling = true,
		data = export.netherlands_provinces,
	},

	-- counties of Norway
	{
		bare_label_setter = subpolity_bare_label_setter("Norway"),
		value_transformer = subpolity_value_transformer("Norway"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county",
		british_spelling = true,
		data = export.norwegian_counties,
	},

	-- provinces of the Philippines
	{
		key_to_placename = chop(", Philippines$"),
		placename_to_key = append(", Philippines"),
		bare_label_setter = subpolity_bare_label_setter("the Philippines"),
		value_transformer = subpolity_value_transformer("the Philippines"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "province",
		default_poldiv = {{"municipalities", parent="municipalities of the Philippines"}},
		data = export.philippine_provinces,
	},

	-- counties of Romania
	{
		key_to_placename = chop(" County, Romania$"),
		placename_to_key = append(" County, Romania"),
		bare_label_setter = subpolity_bare_label_setter("Romania"),
		value_transformer = subpolity_value_transformer("Romania"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county",
		british_spelling = true,
		data = export.romanian_counties,
	},

	-- federal subjects of Russia
	{
		-- No current need for key_to_placename because it's only used in subpolity_bare_label_setter
		-- and subpolity_value_transformer, and we override both handlers.
		placename_to_key = russian_placename_to_key,
		bare_label_setter = function(labels, group, key, value)
			local divtype = value.divtype or group.default_divtype
			if type(divtype) == "table" then
				divtype = divtype[1]
			end
			local bare_key, linked_key = export.construct_bare_and_linked_version(key)
			labels[bare_key] = {
				description = "{{{langname}}} terms related to " .. construct_russian_federal_subject_keydesc(linked_key, divtype) .. ".",
				parents = {ucfirst(divtype) .. "s of Russia"},
			}
		end,
		value_transformer = function(group, key, value)
			value.containing_polity = "Russia"
			local divtype = value.divtype or group.default_divtype
			if type(divtype) == "table" then
				divtype = divtype[1]
			end
			local bare_key, linked_key = export.construct_bare_and_linked_version(key)
			value.keydesc = construct_russian_federal_subject_keydesc(linked_key, divtype)
			return value
		end,
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "oblast",
		british_spelling = true,
		data = export.russian_federal_subjects,
	},

	-- autonomous communities of Spain
	{
		bare_label_setter = subpolity_bare_label_setter("西班牙"),
		value_transformer = subpolity_value_transformer("西班牙"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "自治區",
		british_spelling = true,
		data = export.spanish_autonomous_communities,
	},

	-- states of the United States
	{
		key_to_placename = chop("^美國"),
		placename_to_key = append("美國"),
		bare_label_setter = subpolity_bare_label_setter("美國"),
		value_transformer = subpolity_value_transformer("美國"),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "state",
		default_poldiv = {
			{"counties", parent="counties of the United States"},
			{"county seats", parent="county seats of the United States"},
		},
		data = export.us_states,
	},

	-- constituent countries and provinces of the United Kingdom
	{
		bare_label_setter = subpolity_bare_label_setter("英國"),
		value_transformer = function(group, key, value)
			value = subpolity_value_transformer("英國")(group, key, value)
			-- Don't create categories like 'Category:en:Towns in the United Kingdom'
			-- or 'Category:en:Places in the United Kingdom'.
			value.no_containing_polity_cat = true
			return value
		end,
		place_cat_handler = default_place_cat_handler(),
		default_divtype = {"constituent country", "country"},
		british_spelling = true,
		data = export.uk_constituent_countries,
	},

	-- counties of England
	{
		key_to_placename = chop("^英格蘭"),
		placename_to_key = append("英格蘭"),
		bare_label_setter = subpolity_bare_label_setter("英格蘭"),
		value_transformer = subpolity_value_transformer({"constituent country", "英格蘭"}),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county",
		default_poldiv = {{"districts", parent="districts of England"}},
		british_spelling = true,
		data = export.english_counties,
	},

	-- counties of Northern Ireland
	{
		key_to_placename = northern_ireland_key_to_placename,
		placename_to_key = northern_ireland_placename_to_key,
		bare_label_setter = subpolity_bare_label_setter("Northern Ireland"),
		value_transformer = subpolity_value_transformer({"constituent country", "Northern Ireland"}),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county",
		british_spelling = true,
		data = export.northern_irish_counties,
	},

	-- council areas of Scotland
	{
		key_to_placename = chop("^蘇格蘭"),
		placename_to_key = append("蘇格蘭"),
		bare_label_setter = subpolity_bare_label_setter("蘇格蘭"),
		value_transformer = subpolity_value_transformer({"constituent country", "蘇格蘭"}),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "council area",
		british_spelling = true,
		data = export.scottish_council_areas,
	},

	-- principal areas (cities, counties and county boroughs) of Wales
	{
		key_to_placename = chop(", Wales$"),
		placename_to_key = append(", Wales"),
		bare_label_setter = subpolity_bare_label_setter("威爾士"),
		value_transformer = subpolity_value_transformer({"constituent country", "威爾士"}),
		place_cat_handler = default_place_cat_handler(),
		default_divtype = "county borough",
		british_spelling = true,
		data = export.welsh_principal_areas,
	},

}

function export.format_description(desc, label)
	if desc == nil then
		desc = true
	end
	if desc == true then
		desc = require(topic_cat_utilities_module).link_label(label)
	elseif desc == "w" then
		desc = require(topic_cat_utilities_module).link_label(label, nil, "wikify")
	end
	return desc
end


return export