Template:place/documentation

This template generates definition lines and categories for placenames. The corresponding data module is at Module:place/data.

Usage
The basic usage is as follows (e.g. for ):

which generates and places the page in Category:en:Countries in Europe.

The second parameter is the type of the place, while the third and further parameters are holonyms, indicating the larger entities that the place is contained within. Each holonym is of the form. The type can be spelled out in full, e.g. ; common types can also be abbreviated, e.g.   for   (as above),   for ,   for  ,   for  , etc. The full list of abbreviations is given below.

More than one holonym can be given, e.g. for :

which generates and places the page in Category:en:Cities in Ontario.

The categorization system automatically generates the correct-format definition and category/categories, even when that requires computing a variant name, e.g. for :

which generates and places the page in Category:en:Cities in the Netherlands. In this case, both the definition and category need to have "the" prefixed to the country name, which automatically happens.

As another example, for :

generates and places the page in Category:en:Cities in Pennsylvania, USA. (States of the United States are suffixed with  in some categories, to aid in distinguishing the US state of Georgia from the country of Georgia.)

For place names in foreign languages, a translation in English can be given, which changes the definition format, e.g. for (the French term for Germany):

which generates and places the page in Category:fr:Countries in Europe. (Note that this category has language code, which contains French terms for countries in Europe, rather than English terms.)

Some place types use "of" instead of "in" in the definition and category, e.g. for :

which generates and places the page in Category:en:Counties of Virginia, USA.

Additional descriptive text can be present among the holonyms, and will be formatted correctly in the definition, e.g. for : which generates and places the page in Category:en:Countries in Europe, as above.

Alternative format
For complex cases, an alternative format can be used, which freely allows for placetypes and holonyms to be interspersed among raw text, e.g. as follows (for ): which generates and places the page in Category:en:Neighborhoods in Turkey.

In this format, placetypes and holonyms are surrounded by. The presence of a slash indicates a holonym; no slash indicates a placetype. There is no requirement that placetypes precede holonyms.

In this format, it is possible to break up a multiword placetype if the initial word or words are recognized qualifiers (see below), such as "former" or "ancient". Example: which generates and places the page in Category:en:Historical polities (as  would do), rather than in Category:en:Polities (as   would normally do).

Parameters
Primary parameters:
 * 1: the language code of the entry
 * 2: see 
 * 3, 4, 5, ...: see 
 * t1, t2, t3, ...: English translation(s) of the place
 * tid1, tid2, tid3, ...: sense ID's for the English translation(s) of the place; see
 * cat, cat2, ...: extra categories to add to the page; automatically prefixed by the language code, e.g. Towns in England will add the page to Category:fr:Towns in England if the specified language code is
 * sort: the sort key for the categories generated by the template; rarely needs to be specified, except perhaps for Japanese

Suppression and text parameters:
 * def: replaces the entire definition without affecting the categorization
 * also: adds further text to the type of place without affecting the categorization
 * a: replaces the indefinite article at the beginning of the definition

Extra information parameters: As with holonym parameters (see below), all of these parameters can be prefixed with a language code such as, and prefixing just with   suppresses automatic linking.
 * modern, modern2, ...: the modern name(s) or location(s) of the place
 * official, official2, ...: the official name(s) of the place (e.g. People's Republic of China for China)
 * capital, capital2, ...: the capital city/cities of the place
 * largest city, largest city2, ...: the largest city/cities of the place
 * caplc: the capital and largest city of the place
 * seat, seat2, ...: the seat(s) of the place, particularly for counties and equivalents; displays "county seat", "parish seat" or "borough seat" for counties, parishes and boroughs respectively; otherwise, displays just "seat"
 * shire town, shire town2, ...: the shire town (similar to a county seat) of the place, particularly for counties in Vermont

Placetype parameter
The type(s) of place of the entry, such as,   or. Multiple values are separated by a slash. The special value  suppresses the comma and doesn’t affect categorization.

The placetype parameter can be pluralized and will be handled correctly. For example: displays as and places the page in Category:en:Unincorporated communities in Illinois, USA and Category:en:Unincorporated communities in the United States.

The aliases that are recognized for holonym placetypes (see below) can also be used here and will automatically be expanded, but as a matter of style it is recommended to spell out the placetype in full except for generally-recognized aliases such as  for census-designated place.

Holonym parameters
A holonym parameter has the following format: placetype/placename. The format placetype/langcode:placename can be used to specify a non-English placename. Normally, the placename will automatically be linked; using  with no langcode suppresses automatic linking. Automatic linking is done exactly as if were being used, which means that square brackets can be used inside it to link to individual parts, and  can be used to link to Wikipedia.

If the placetype and following slash are omitted, the parameter is displayed as regular text.

If there are multiple holonyms, commas are placed before all holonyms except the first, according to the following algorithm: This does not apply to the alternative format described above, where raw text, placetypes and placenames are freely interspersed and no extra commas are added unless multiple placenames are grouped together (see below).
 * 1) No comma is placed before the first holonym (whether a placename or raw text).
 * 2) No comma is placed before a holonym (whether a placename or raw text) preceded by raw text.
 * 3) No comma is placed before the special raw-text values   and.
 * 4) A comma is placed before all other holonyms.

Grouped holonyms
Multiple comma-separated placenames can be given, and are formatted correctly and individually linked. For example:

Holonyms that take "the"
Some holonyms are normally preceded by "the", as in "the United States", while others aren't, e.g. "France". Holonyms that are normally preceded by "the" will have this added if they occur either as (1) the first-specified holonym parameter; (2) the non-first holonym in a multi-holonym list (for this, see the example just above); (3) when accompanied by the  or   modifiers (see below). In other positions, they will not be preceded by "the", e.g.:

Holonym placetype aliases
Several aliases are recognized for placetype: [etc.]
 * →  (should be used for England, Scotland, and Wales)
 * →  (should be used for England, Scotland, and Wales)
 * →  (should be used for England, Scotland, and Wales)
 * →  (should be used for England, Scotland, and Wales)
 * →  (should be used for England, Scotland, and Wales)

The full list can be found below under Recognized placetypes, which lists all recognized placetypes along with the aliases (if any) of each placetype.

Holonym placetype modifiers
Following the holonym placetype can be a colon followed by one or more comma-separated modifiers, e.g. . Currently, the following modifiers are recognized: The reasons for using such a modifier are that (a) category recognition code is based off the full holonym placename, and hence won't work properly if a holonym like  is used; and (b) the bare holonym without the prefix or suffix will be autolinked, without the need to explicitly inserted brackets around the bare holonym.
 * : Display the full placetype as a lowercase suffix, e.g.  →.
 * : Display the full placetype as a capitalized suffix, e.g.  →.
 * : Display the full placetype as a lowercase prefix, e.g.  →   (the initial "the" is displayed in the same circumstances as when it is displayed before a holonym like "United States"; see above).
 * : Display the full placetype as a capitalized prefix, e.g.  →   (the initial "the" is displayed in the same circumstances as when it is displayed before a holonym like "United States"; see above).
 * : Suppress the default display of a prefix or suffix (see below).

Note that some holonym placetypes have prefixes or suffixes attached by default, e.g.: This affixing does not happen if the holonym placename already has the placetype or a part of it in it, if an explicit prefixing or suffixing modifier is used, or if the modifier  is used.
 * "canton", "civil parish", "community development block", "council area", "county borough", "department", "district", "district municipality", "local government district" (suffixed with "district"), "London borough" (suffixed with "borough"), "parish", "peninsula", "subdivision", "tehsil"
 * "autonomous oblast", "autonomous okrug", "census area", "krai", "oblast", "okrug", "regional county municipality"
 * "metropolitan borough", "municipal district", "regional district", "regional municipality", "rural municipality"

Examples:

Multiple descriptions
The special value  restarts the description and categorization (except for the language code), and joins the two descriptions with a semicolon. For example: The main reason to use this format, as opposed to simply stringing the entire description together, is that categorization is restarted. This allows for more flexible categorization of places that serve multiple functions than would otherwise be possible.

More generally, any value beginning with a  and not immediately followed by a space has the same restarting behavior, and in addition the text after the semicolon serves as the joining text, in place of a semicolon. For example: If the joining text begins with an ASCII or Unicode letter, a space is placed before the joining text, otherwise no space is added, as above. Finally, the special value  joins the descriptions with only a space.

Guide to adding new items to the data module
Module:place/data controls the categorization of entries and some issues concerning the wording of definitions. This section will show, as an example, how to change the categorization and display of archipelagos.

Each index of the variable export is a placetype. You can begin by adding the item ["archipelago"] = { },

Each item has subitems for individual countries and one called "default". These subitems have subsubitems that indicate whether the entry should be categorized under the given holonym. The special index of "itself" indicates that the entry is categorized without a holonym. For example, if we add the following code: ["archipelago"] = { ["country/Indonesia"] = { ["province"] = {true}, ["country"] = {true}, },

["default"] = { ["itself"] = {true}, }, }, Then entries for archipelagos in Indonesia will be categorized under Category:langcode:Archipelagos in Province, Indonesia, or Category:langcode:Archipelagos in Indonesia if a province is not provided. For all other countries, or when no country is given, the entry will be added to Category:langcode:Archipelagos.

Instead of true, you can use a string to replace the word Archipelagos in the category. For example, if in the default subitem you used instead ["itself"] = {"Islands"}, Then archipelagos outside of Indonesia would be added to Category:langcode:Islands

If the type of place requires wording more complicated than “place A, place B, place C, ”, a variable called synergy= can be used. Each subitem of this variable is the type of place that precedes it, and has the variables before=, between= and after=. synergy = { ["island"] = { before = "in the island of", between = "in the", after = "archipelago" }, 	}, This would make generate “A village in the island of Komodo in the Lesser Sunda archipelago.”

The other variables are:
 * : Replace the default preposition "in" in definitions and categories (e.g. “A department of France” instead of “A department in France”).
 * : Replace the default plural in categories (e.g. “Kibbutzim in Israel” instead of “Kibbutzes in Israel”). The default pluralizing algorithm is very smart and almost always works (e.g. city -> cities, valley -> valleys, parish -> parishes, pass -> passes, commonwealth -> commonwealths), so this is rarely necessary.
 * : Replace the default article "a"/"an" in definitions when occurring as the entry placetype (e.g. “The capital of” instead of “A capital of”). The value will almost always be "the".
 * : Specify an article to add to holonyms containing this placetype (e.g.  -> "the Nile" instead of just "Nile").
 * : Specify that holonyms containing this placetype will automatically have a prefix or suffix added, as described above under . Possible values are,  ,   and.
 * : Specify the affix to use in conjunction with, instead of using the placetype itself (e.g. "local government district" specifies  ).
 * : Used in conjunction with ; specifies a string or list of strings which, if occurring in the holonym, will disable automatic affixation. Defaults to the placetype itself. Matching is case-insensitive. For example, "autonomous okrug" specifies   (so that if "okrug" or "Okrug" occurs in the holonym, it will disable affixing), and "district municipality" specifies   (so that if either "district" or "municipality", capitalized or lowercase, occurs in the holonym, it will disable affixing).
 * : Specify a function to control the display of the holonym. Passed two arguments, the holonym placetype and placename, and should return the string to display.
 * : Specify a function to control the categorization of the holonym. Passed three arguments, the holonym placetype and placename and the full place spec that describes all facets of the place description (described in more detail in the comments to Module:place). Should return a table such as, i.e. in the same format as the innermost table in the holonym's category spec, as described above.

Recognized placetypes
The following placetypes are recognized by the module, and processed specially. This does not mean that other placetypes cannot be used, but they will not get special handling (e.g. their display form will not be linked and they will not trigger any categorization).

Recognized placenames
The following place names are recognized by the module, and handled specially in some fashion. Note that there's nothing preventing any place name from being used. Note that items in the third and fourth columns are boldfaced if they are different from the placename in the first column.

Recognized qualifiers
The following qualifiers are recognized by the module. This means that if such a qualifier is used before a recognized placetype, the placetype will still be recognized and processed as normal. Note that items in the second column are boldfaced if they are different from the qualifier in the first column.