Lua

CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

This documentation is transcluded from Module:Countries/Africa/doc.

The countries and text displayed for a particular region are defined in a subpage of Module:Countries. For example, Module:Countries/Africa lists the countries in Africa and defines text such as "Countries of Africa" that is displayed if the user's language is en, and "Staaten in Afrika" if it is de. Country names are obtained from Wikidata.

How to create data modules

edit

Translated section titles

edit

Each section under titles defines text that depends on the current user's language. The procedures that apply to {{Fallback}} are used to determine which language should be used.

TODO: Standard titles should be defined in one module so they do not need to be duplicated for each countries submodule. Only items listed in each section are translated once from Wikidata labels. This may require adding also Wikidata entries for them (or locating existing Wikidata items for their topic), and being able to select their plural form when needed.

Pattern or ordered list of subpatterns

edit

Module:Countries/Africa defines pattern twice. The first is a pattern for the text that is normally displayed by {{Countries of Africa}}, while the second applies when the parameter |simple=yes is used.

Each occurrence of {name} in the pattern is replaced with appropriate text. The names used for Africa when simple does not apply are:

Name Description
{lang} User's language from {{Int:Lang}} such as "en" or "de".
{dir} Direction "ltr" or "rtl" selected using lang.
{colon} Equivalent of ": " from {{Colon|lang={{Int:Lang}}}}; do not insert any space after it.
{maintitle} Title from titles.main selected using lang.
{othertitle} Title from titles.other selected using lang.
{mainlist} List of country codes from lists.main selected using lang.
{otherlist} List of country codes from lists.other selected using lang.
{partlylist} List of country codes from lists.partly used to render a note only (this list is not sorted by languages as it is not displayed, but it provides the condition for which the note will be added, i.e. when one of the other lists includes a country which is displayed with an extra mark calling for this note).

You can specify patterns in various ways, the simplest one being a single string containing all the layout wikitext and {name} placeholders described above. This will only generate a static list with a single layout.

But you can also split the pattern into multiple "conditional supatterns" (all of them containing arbitrary wikitext or {name} placeholders), and put them in an ordered table, in the order in which they must appear on the result. This allows some fragments of the layout to be removed (for example dropping the section title if the list after it in the same section is empty, or dropping the static separators between sections).

Each "conditional subpattern" is represented either:

  • as a simple string like 'subpattern with {name} placeholders' when there's no condition (this unconditional pattern will be always added to the result), or
  • as an ordered table, where:
    • first element is a string for the subpattern, and
    • the other elements represent an union of several (non-exclusive) "conditions"
    for example, { 'subpattern with {name} placeholders', condition1, condition2, ... }
    (if any one of the listed conditions evaluates to true (OR), the conditional subpattern will be used).

Each "condition" listed in a array after the initial subpattern may itself be represented either:

  • as a simple string for "simple conditions", or
  • as an ordered table of "subconditions", i.e. a conjunction of several (non-exclusive) simple conditions
    for example, { 'subpattern with {name} placeholders', { subcondition1, subcondition2, ... }, ... }
    (if any one of the subconditions evaluates to false (AND), the conditional subpattern will NOT be used according to this condition, but may be used if other conditions part of the union allow it).

Each "simple condition" is used to evaluate tests based on names of variables (usable in placeholders of patterns or subpatterns). A simple condition is represented by a string and can currently take one the following forms:

  • 'name'  : the simple condition is true if the variable with that name is non-empty (i.e. the subpattern {name} would be replaced by an actual text);
  • '!name' : the simple condition is true if the variable with that name is empty (i.e. the subpattern {name} would be replaced by nothing);

The variable names used in simple conditions don't need to be present within the "conditional subpattern" string to which the condition applies (indicated at start of the table describing the conditional subpattern). This means for example that a subpattern continaining only static wikitext and no {name} placeholder, can be conditional. This is useful notably

  • to generate static wikitext (for example breaks or punctuation or other presentational elements), that will be present in the result only if other conditional patterns actually generate text (depending on their own placeholders).
  • to suppress every layout elements surrounding the inner content, when there's nothing useful to display: the result can then be entirely empty.

Simple presentation in a single section

edit

If the template that invokes the module has |simple=yes, the simple section is used.

  • simple.pattern replaces pattern
  • simple.sections specifies which sections from titles and lists will be processed.

In Module:Countries/Africa, simple.sections has

main = { EH = true, },

The fact that main is defined means that titles.main and lists.main will be used. The fact that other is not defined means that titles.other and lists.other will be ignored.

EH = true is used when simple does not apply. When the template is used normally (without |simple=yes), the country identified by EH is ignored. That is done because EH is included in the other section. However, with |simple=yes, EH will appear in the main section.

The simple version can also use a single pattern, or multiple conditional subpatterns like previously.

Orderable lists of items, one for each section

edit

Each section under lists defines the list of country codes that will be used to display country names. Similarly to titles, the list depends on the current user's language.

Countries are listed in the order specified. If the default order is unsatisfactory for a particular language, an entry for the language can be added. The entry should include all the country codes in a suitable order.

For example, lists.main may include the following (... replaces some text omitted for simplicity).

main = {
    english   = 'automatic',
    default   = 'automatic sorted',
    en        = 'automatic sorted',
    mk        = 'DZ AO BJ BW BF BI CM CAVE CF TD KM CI ... SADR EH ZM ZW',
    automatic = 'DZ AO BJ BW BF BI CM CAVE CF TD KM CD ...   UG EH ZM ZW',
},

Each country code such as DZ is defined under countries. All lists should contain the same codes, only ordered differently depending on language; every localized list (keyed by language code) should then have exactly the same length as the one given for the 'automatic' list (which is required), or should be one of 'automatic sorted' or 'automatic'.

The following keys have special meaning when used before =.

automatic Must be defined if any other parameter is set to 'automatic' or 'automatic sorted'. The listed codes should be ordered according to the English names, so that they don't need sorting (see below).
default The fallback entry used if the user's language is not defined ({{Fallback}} falls back to en if it is defined and no more applicable entry is defined).
english The entry used if the user's language is en. This is an optimization to avoid the overhead of automatic processing for a commonly used language.

The following values have special meaning when used after =.

'automatic' This entry will use the list of country codes defined in the automatic = '...' parameter.
'automatic sorted' Same as 'automatic' but (unless option all is set) the country names will be reordered using a crude sorting algorithm.

A module is not able to properly collate names for a language other than en. However, Module:Countries can satisfactorily collates some names that use letters with diacritics which sort after their equivalent letters.

The collation (performed only when the option all is not set when calling the main function Module:Countries) is based on a function, defined in Module:MakeSortKey, creating sort keys from a translated label and the target language code (this language code could be later used to tailor the collation according to sorting rules for specific languages, but for now the sort order is locale-neutral). Generally, this sorting works for most languages, but the localisation may be needed to take into account ignorable prefixes, or for complex scripts that still have no support for a basic collation order.

Definitions of each list item

edit

Several examples from a countries table follow:

countries = {
    CI    = { 'Ivory Coast', "Côte d'Ivoire",  qid = 'Q1008', },
    DZ    = { 'Algeria',                       qid = 'Q262', },
    EG    = { 'Egypt',                         qid = 'Q79', mark = '‡', },
    GM    = { 'Gambia',                        qid = 'Q1005', the = true, },
    XBRTW = { 'Bir Tawil',                     qid = 'Q620634', },
}

CI, DZ, EG, and GM are country codes that identify a particular country. Where available, ISO 3166-2 codes are used, but any code can be used as they only have a meaning within the module (you should use a private extension, starting by "X", of ISO 3166-1 if the territory is part of another recognized country but has no ISO 3166-2 code, or use one of the prefixes reserved in ISO 3166-1 for private use, like "AA", "QM" to "QZ", "X", or "ZZ").

Note that Module:Countries is generic and is not restricted for listing only countries, it can process any list of up to 200 known items; the key defined as countries = {...} above can be alternatively named infos = {...} with the same content for list items.

The country names Algeria and Gambia are the titles of pages which should exist at Commons, and where the category page generally also exists. English names should be used but need to match names used in titles of titles in Commons. If several alternative names are used in Commons to refer to the same country in related page titles (such as "Côte d'Ivoire"), you may list these alternate names.

The qid codes identify the corresponding item at Wikidata. It allows translating the displayed label in the user's language (when option all is not set to render the box). For example,

  • d:Q262 on Wikidata is associated to Algeria on Commons, and will also be used to get the translated label for other related pages like Category:Algeria
  • d:Q1005 on Wikidata is associated to Gambia on Commons, and will also be used to get the translated label for other related pages like Category:Gambia

If the |all=yes option is not set to render the box, or if qid is not defined, or if qid is not found in Wikidata, or Wikidata does not define a label for it, then the first name listed in the data defining the country (normally in English and used in page titles in Commons) will be used as a default (untranslated) label.

Normally, a link is shown in the rendered bulleted lists only if the page exists.

But when rendering the list with |all=yes option, all possible page titles will be listed, without testing their existence, and without translating the displayed labels (this will frequently generate red links, but it allows the maintenance of page names on Commons, to find those that redirect to unexpected pages, or to facilitate the creation of missing pages with coherent titles that will be found and used when the |all=yes option will be removed to hide all possible aliases from the list and to get translated and sorted labels).

The entry for Gambia illustrates use of the optional the in country's data, whose effect is that the Gambia is tested for existence before Gambia: if a page exists in Commons using the in its title, this page will be selected as the target of the link.

The wikitext for each link has the following form:

[[PrefixTitleSuffix|<bdi>Label</bdi>]]
Prefix Consists of the specified prefix and separator (or space).
Title The name specified in the countries table, possibly prefixed by the (only if the data defining a country code includes the = true).
Suffix Consists of the specified separator (or space) and suffix.
bdi bidirectional isolation in HTML
Label The label from Wikidata for the specified qid in the current user's language.

The entry for Egypt illustrates use of the optional mark in country's data, whose effect is that a superscripted mark will be added after the label. This is used as a note call, which will be rendered at bottom of the table. If you use such marks, you should create a conditional section (such as "partly") which lists all concerned codes (in arbitrary code order); this list will not be rendered, but will appear conditionally if any one of the listed codes is displayed from the other lists.

edit

This list (currently maintained in Module:Convert/tester) is partial but contains the most frequently used modules. It autodetects differences between the normal modules and templates and their sandbox version, and list their associated testcases and talk pages (when they exist).

It also shows that the main module is not necessarily used for listing countries (or territories), it could be used as well to create navigation boxes for lists of cities, chemical elements, and so on, provided that these lists are bounded, wellknown and stable over years (and not overlong) : if a list contains more than 200 items, consider generated separate modules and navbox for sublists using some criteria). New data modules also don't necessarily have to be created and named as subpages of Module:Countries.

The sandbox versions of modules should be identical, except temporarily for testing changes (rendered with the sandbox template, in their comparative test cases)

The sandbox versions of these templates should be different as they use the sandbox version of the modules.

How to make changes and preview them using sandboxes

edit

For example, {{Countries of Africa/sandbox}} displays:

If the user's language is en, Module:Countries/Africa/sandbox could be edited and

en = 'Countries of Africa',

changed to

en = 'African countries',

Do not save the change. Instead, under "Preview page with this template" enter the title of this page

Module:Countries/Africa/doc

then click "Show preview". That will display this documentation page including the output from the above {{Countries of Africa/sandbox}} template. The output will start with "African countries" instead of "Countries of Africa". In the same manner, other changes could be made and previewed before saving the changes. Close the current browser window without saving the changes to discard them (or get back to a previous page using the button of the browser navigating in the session history).

Before updating the main data module, changes should be made in the sandbox data module and tested with the sandbox template.

Code

-- Data defining countries for {{#invoke:Countries|main|Africa}}.

--[=[ Output is pattern after making these substitutes:
{lang}		User's language from {{int:lang}} such as 'en' or 'de'.
{dir}		Language direction 'ltr' or 'rtl'.
{colon}		Language equivalent of ": " from {{colon|lang}}.
{XYZtitle}	Title for lang from XYZ section of defined titles.
{XYZlist}	List of countries for lang from XYZ section of defined lists.
			XYZ must consist of en alphabetic characters [A-Za-z].
]=]
return {
	titles = {
		main = {
			default = 'Countries of Africa',
			am = 'የአፍሪካ አገሮች',
			ar = 'بلدان أفريقيا',
			az = 'Afrika ölkələri',
			be = 'Краіны Афрыкі',
			['be-tarask'] = 'Краіны Афрыкі',
			bg = 'Африкански държави',
			bn = 'আফ্রিকার দেশসমূহ',
			br = 'Stadoù Afrika',
			bs = 'Države u Africi',
			ca = 'Països d’Àfrica',
			ceb = 'Mga nasud sa Aprika',
			co = 'Paesi di Africa',
			crh = 'Afrikadaki memleketler',
			cs = 'Státy Afriky',
			cy = 'Gwledydd Affrica',
			da = 'Lande i Afrika',
			de = 'Staaten in Afrika',
			el = 'Αφρικανικά κράτη',
			en = 'Countries of Africa',
			eo = 'Landoj de Afriko',
			es = 'Países de África',
			et = 'Aafrika riigid',
			eu = 'Afrikako Herrialdeak',
			fa = 'کشورهای آفریقا',
			fi = 'Afrikan valtiot',
			fr = 'Pays d’Afrique',
			fy = 'Lannen fan Afrika',
			ga = 'Tíortha na hAfraic',
			gd = 'Dùthchannan Afraga',
			gl = 'Países de África',
			gu = 'આફ્રિકાના દેશો',
			ha = 'Kasashen Afirka',
			haw = 'Nā Aupuni oʻApelika.',
			he = 'מדינות אפריקה',
			hi = 'अफ्रीका के देश',
			hmn = 'Lub teb chaws Africa',
			hr = 'Države u Africi',
			hsb = 'Staty w Afrikje',
			ht = 'Peyi nan Lafrik',
			hu = 'Afrika országai',
			hy = 'Աֆրիկայի երկրներ',
			id = 'Negara-negara di Afrika',
			ig = 'Mba Afrika',
			is = 'Afríkulönd',
			it = 'Paesi d’Africa',
			ja = 'アフリカ諸国',
			jv = 'Negara ing Afrika',
			ka = 'აფრიკის ქვეყნები',
			kk = 'Африкадағы елдер',
			km = 'បណ្តាប្រទេសនៅអាហ្វ្រិក។',
			kn = 'ಆಫ್ರಿಕಾದಲ್ಲಿ ದೇಶಗಳು',
			ko = '아프리카 국가',
			ku = 'Welatên Afrîka',
			ky = 'Африка өлкөлөрү',
			la = 'Civitates Africae',
			lb = 'Länner an Afrika',
			lo = 'ປະເທດໃນອາຟຣິກາ',
			lt = 'Afrikos valstybės',
			lv = 'Āfrikas valstis',
			mg = 'Firenena ao Afrika',
			mi = 'Whenua i Awherika',
			mk = 'Земји во Африка',
			ml = 'ആഫ്രിക്കയിലെ രാജ്യങ്ങൾ',
			mn = 'Африкийн орнууд',
			mr = 'आफ्रिकेतील देश',
			ms = 'Negara-negara di Afrika',
			mt = 'Pajjiżi tal-Afrika',
			mwl = 'Paízes de la África',
			my = 'အာဖရိက၏နိုင်ငံများ',
			nb = 'Land i Afrika',
			ne = 'अफ्रिकामा रहेका देशहरू',
			nl = 'Landen in Afrika',
			nn = 'Land i Afrika',
			no = 'Land i Afrika',
			ny = 'Mayiko a Africa',
			pa = 'ਅਫਰੀਕਾ ਵਿੱਚ ਦੇਸ਼',
			pl = 'Państwa Afryki',
			ps = 'په افریقا کې هیوادونه',
			pt = 'Países da África',
			ro = 'Țări în Africa',
			ru = 'Страны Африки',
			sd = 'آفريڪا ۾ ملڪ',
			si = 'අප්රිකාවේ රටවල්',
			sk = 'Štáty v Afrike',
			sl = 'Države v Afriki',
			sm = 'Atunuu i Aferika',
			sn = 'Nyika muAfrica',
			so = 'Wadamada Afrika',
			sq = 'Shtete në Afrikë',
			sr = 'Државе у Африци',
			['sr-latn'] = 'Države u Africi',
			st = 'Linaha tsa Afrika',
			su = 'Nagara di Afrika',
			sv = 'Afrikas länder',
			sw = 'Nchi za Afrika',
			ta = 'ஆப்பிரிக்கா நாடுகள்',
			te = 'ఆఫ్రికా దేశాలు',
			tg = 'Кишварҳо дар Африқо',
			th = 'ประเทศในแอฟริกา',
			tl = 'Mga Bansa sa Africa',
			tok = 'ma mute pi ma Apika',
			tr = 'Afrika ülkeleri',
			uk = 'Країни Африки',
			ur = 'افریقہ میں ممالک',
			uz = 'Afrika mamlakatlari',
			vi = 'Các quốc gia ở Châu Phi',
			xh = 'Amazwe aseAfrika',
			yi = 'לענדער אין אפריקע',
			yo = 'Awọn orilẹ-ede Afirika',
			['zh-hans'] = '非洲国家',
			['zh-hant'] = '非洲國家',
			zu = 'Amazwe ase-Afrika',
		},
		limited = {
			default = 'Limited recognition',
			af = 'Beperkte erkenning',
			am = 'የተገደበ እውቅና',
			ar = 'اعتراف محدود',
			az = 'Məhdud tanınma',
			be = 'Абмежаваную прызнанне',
			['be-tarask'] = 'Абмежаванае прызнаньне',
			bg = 'Ограничено признаване',
			bn = 'সীমিত স্বীকৃতি',
			bs = 'Ograničeno priznanje',
			ca = 'Reconeixement limitat',
			ceb = 'Limitado nga pagkilala',
			co = 'Recunerazione limitata',
			cs = 'Omezené uznání',
			cy = 'Cydnabyddiaeth gyfyngedig',
			da = 'Begrænset anerkendelse',
			de = 'Begrenzte Anerkennung',
			el = 'Περιορισμένη αναγνώριση',
			en = 'Limited recognition',
			eo = 'Limigita rekono',
			es = 'Reconocimiento limitado',
			et = 'Osaliselt tunnustatud',
			eu = 'Onarpen mugatua',
			fa = 'شناخت محدود',
			fi = 'Rajoitettu tunnustaminen',
			fr = 'Reconnaissance limitée',
			fy = 'Begrűde erkenning',
			ga = 'Aitheantas teoranta',
			gd = 'Aitheantas cuibhrichte',
			gl = 'Recoñecemento limitado',
			gu = 'મર્યાદિત માન્યતા',
			ha = 'Ƙididdigar iyaka',
			haw = 'Kaʻike kūpono',
			he = 'הכרה מוגבלת',
			hi = 'सीमित मान्यता',
			hmn = 'Tsuas paub ntau dua',
			hr = 'Ograničeno priznanje',
			ht = 'Rekonesans limite',
			hu = 'Korlátozott elismerés',
			hy = 'Սահմանափակ ճանաչում',
			id = 'Pengakuan terbatas',
			ig = 'Njirimara ole na ole',
			is = 'Takmarkaður viðurkenning',
			it = 'Riconoscimento limitato',
			ja = '限定認識',
			jv = 'Pangenalan sing winates',
			ka = 'ნაწილობრივ აღიარება',
			kk = 'Шектеулі тану',
			km = 'ការទទួលស្គាល់មានកម្រិត។',
			kn = 'ಸೀಮಿತ ಮಾನ್ಯತೆ',
			ko = '제한된 인정',
			ku = 'Nasnameyê sînor e',
			ky = 'Чектелген деп таануу',
			la = 'Stricto agnitio',
			lb = 'Begrenzter Unerkennung',
			lo = 'ການຈໍາກັດການຈໍາກັດ',
			lt = 'Ribotas pripažinimas',
			lv = 'Ierobežota atzīšana',
			mg = 'Fankasitrahana voafetra',
			mi = 'Ko te mohiotanga iti',
			mk = 'Делумно признаени',
			ml = 'പരിമിതമായ അംഗീകാരം',
			mn = 'Хязгаарлагдмал хүлээн зөвшөөрөлт',
			mr = 'मर्यादित ओळख',
			ms = 'Pengiktirafan terhad',
			mt = 'Rikonoxximent limitat',
			mwl = 'Recoincimiento lhemitado',
			my = 'ကန့်သတ်အသိအမှတ်ပြုမှု',
			nb = 'Begrenset anerkjennelse',
			ne = 'सीमित पहिचान',
			nl = 'Beperkte erkenning',
			nn = 'Avgrensa anerkjenning',
			no = 'Begrenset anerkjennelse',
			pa = 'ਸੀਮਿਤ ਮਾਨਤਾ',
			pl = 'Ograniczone uznanie',
			ps = 'محدود پېژندل',
			pt = 'Reconhecimento limitado',
			ro = 'Recunoaștere limitată',
			ru = 'Частичное признание',
			sd = 'محدود تسليم',
			si = 'සීමිත පිළිගැනීමක්',
			sk = 'Obmedzené uznanie',
			sl = 'Omejeno priznanje',
			sm = 'Faʻatapulaʻaina le aloaia',
			sn = 'Kuchengetedzwa kwemadiki',
			so = 'Aqoonsi xadidan',
			sq = 'Njohja e kufizuar',
			sr = 'Ограничено признање',
			['sr-latn'] = 'Ograničeno priznanje',
			st = 'Ho amoheloa ka molao',
			su = 'Pangakuan kawates',
			sv = 'Begränsat erkännande',
			sw = 'Utambuzi mdogo',
			ta = 'வரையறுக்கப்பட்ட அங்கீகாரம்',
			te = 'లిమిటెడ్ గుర్తింపు',
			tg = 'Қабули маҳдуд',
			th = 'การรับรู้ที่ จำกัด',
			tl = 'Limitadong pagkilala',
			tr = 'Sınırlı tanınma',
			uk = 'Обмежене визнання',
			ur = 'محدود شناخت',
			uz = 'Cheklangan tan olinishi',
			vi = 'Nhận dạng hạn chế',
			xh = 'Ukuqaphela okukodwa',
			yi = 'לימיטעד דערקענונג',
			yo = 'Ilana ti a lopin',
			['zh-hans'] = '有限承认',
			['zh-hant'] = '有限承認',
			zu = 'Ukuqaphela okulinganiselwe',
		},
		other = {
			default = 'Other areas',
			af = 'Ander gebiede',
			am = 'ሌሎች ግዛቶች',
			ar = 'مناطق أخرى',
			az = 'Digər ərazilər',
			be = 'Іншыя тэрыторыі',
			['be-tarask'] = 'Іншыя тэрыторыі',
			bg = 'Други територии',
			bn = 'অন্যান্য অঞ্চলসমূহ',
			bs = 'Druge teritorije',
			ca = 'Altres territoris',
			ceb = 'Ubang mga teritoryo',
			co = 'Altre territoriu',
			cs = 'Jiná území',
			cy = 'Tiriogaethau eraill',
			da = 'Andre områder',
			de = 'Weitere Gebiete',
			el = 'Άλλα εδάφη',
			en = 'Other areas',
			eo = 'Aliaj teritorioj',
			es = 'Otros territorios',
			et = 'Muud territooriumid',
			eu = 'Beste lurralde batzuk',
			fa = 'سرزمین های دیگر',
			fi = 'Muut alueet',
			fr = 'Autres territoires',
			fy = 'Oare gebieten',
			ga = 'Críocha eile',
			gd = 'Tìrean eile',
			gl = 'Outros territorios',
			gu = 'અન્ય પ્રદેશો',
			ha = 'Sauran yankuna',
			haw = 'Nā’āina’ē aʻe.',
			he = 'טריטוריות אחרות',
			hi = 'अन्य प्रदेश',
			hmn = 'Lwm thaj',
			hr = 'Ostali teritoriji.',
			ht = 'Lòt teritwa',
			hu = 'Egyéb területek',
			hy = 'Այլ տարածքներ',
			id = 'Wilayah lain',
			ig = 'Ógbè ndị ọzọ',
			is = 'Önnur svæði',
			it = 'Altri territori',
			ja = 'その他の地域',
			jv = 'Wilayah liya',
			ka = 'სხვა ტერიტორიები',
			kk = 'Басқа аумақтар',
			km = 'ដែនដីផ្សេងទៀត។',
			kn = 'ಇತರ ಪ್ರದೇಶಗಳು',
			ko = '기타 지역',
			ku = 'Herêmên din',
			ky = 'Башка аймактар',
			la = 'Alii fines',
			lb = 'Aner Territoiren',
			lo = 'ອານາເຂດອື່ນໆ',
			lt = 'Kitos teritorijos',
			lv = 'Citas teritorijas',
			mg = 'Faritra hafa',
			mi = 'Ētahi atu rohe',
			mk = 'Други подрачја',
			ml = 'മറ്റ് പ്രദേശങ്ങൾ',
			mn = 'Бусад нутаг дэвсгэрүүд',
			mr = 'इतर प्रदेश',
			ms = 'Wilayah lain',
			mt = 'Territorji oħra',
			my = 'အခြားသော နယ်မြေများ',
			nb = 'Andre territorier',
			ne = 'अन्य इलाकाहरू',
			nl = 'Andere gebieden',
			nn = 'Andre territorium',
			no = 'Andre territorier',
			ny = 'Madera ena',
			pa = 'ਹੋਰ ਇਲਾਕਿਆਂ',
			pl = 'Inne terytoria',
			ps = 'نور ساحې',
			pt = 'Outras áreas',
			ro = 'Alte teritorii',
			ru = 'Другие территории',
			sd = 'ٻين علائقن ۾',
			si = 'වෙනත් ප්රදේශ',
			sk = 'Ďalšie územia',
			sl = 'Druga ozemlja',
			sm = 'Isi teritori',
			sn = 'Dzimwe ndima',
			so = 'Goobaha kale',
			sq = 'Territore të tjera',
			sr = 'Друге територије',
			['sr-latn'] = 'Druge teritorije',
			st = 'Libaka tse ling',
			su = 'Wewengkon séjén',
			sv = 'Övriga territorier',
			sw = 'Sehemu nyingine',
			ta = 'மற்ற பிரதேசங்கள்',
			te = 'ఇతర భూభాగాలు',
			tg = 'Дигар минтақаҳо',
			th = 'ดินแดนอื่น ๆ',
			tl = 'Iba pang mga teritoryo',
			tr = 'Diğer bölgeler',
			uk = 'Інші території',
			ur = 'دیگر علاقوں',
			uz = 'Boshqa hududlar',
			vi = 'Các lãnh thổ khác',
			xh = 'Ezinye iindawo',
			yi = 'אנדערע טעריטאָריע',
			yo = 'Awọn agbegbe miiran',
			['zh-hans'] = '其他地区',
			['zh-hant'] = '其他地區',
			zu = 'Ezinye izindawo',
		},
		partly = {
			default = 'partly located in Africa',
			bn = 'আংশিকভাবে আফ্রিকায় অবস্থিত',
			ca = 'parcialment a Àfrica',
			cs = 'částečně v Africe',
			de = 'teilweise in Afrika',
			en = 'partly located in Africa',
			es = 'parcialmente ubicado en África',
			fr = 'situé partiellement en Afrique',
			it = 'in parte situato in Africa',
			ja = '一部アフリカにある',
			nb = 'delvis i Afrika',
			nl = 'deels gelegen in Afrika',
			nn = 'delvis i Afrika',
			no = 'delvis i Afrika',
			pt = 'parcialmente localizado na África',
			ru = 'частично находится в Африки',
			sl = 'delno v Afriki',
			['zh-hans'] = '部分位于非洲',
			['zh-hant'] = '部分位於非洲',
		},
	},
	pattern = {
		{	'<div lang="{lang}" dir="{dir}" class="catlinks"' ..
			' style="clear:none;display:table;box-sizing:border-box;max-width:100%;font-size:88%;line-height:normal;margin:2px 0;padding:2px"><div style="display:table-cell;width:100%">',
				'mainlist',
				'limitedlist',
				'otherlist',
		},
		{	'<em>{maintitle}{colon}</em>',
				{ 'maintitle', 'mainlist', },
		},
			'{mainlist}',
		{	'<br /> ',
				{ 'mainlist', 'limitedlist', },
				{ 'mainlist', 'otherlist', },
		},
		{	'<em>{limitedtitle}{colon}</em>',
				{ 'limitedtitle', 'limitedlist', },
		},
			'{limitedlist}',
		{	'&nbsp;– ',
				{ 'limitedlist', 'otherlist', },
		},
		{	'<em>{othertitle}{colon}</em>',
				{ 'othertitle', 'otherlist', },
		},
			'{otherlist}',
                {	'<br /> <small style="font-size:88%"><sup>‡</sup></small>{colon}<em>{partlytitle}</em>',
				'partlylist',
		},
		{	'</div></div>',
				'mainlist',
				'limitedlist',
				'otherlist',
		},
	},
	simple = {
		pattern = {
			{	'<div lang="{lang}" dir="{dir}" class="catlinks"' ..
				' style="clear:none;display:table;box-sizing:border-box;max-width:100%;font-size:88%;line-height:normal;margin:2px 0;padding:2px"><div style="display:table-cell;width:100%">',
					'mainlist',
			},
			{	'<em>{maintitle}{colon}</em>',
					{ 'maintitle', 'mainlist', },
			},
				'{mainlist}',
			{	'</div></div>',
					'mainlist',
			},
		},
		sections = {
			-- List of sections to be displayed if simple=yes.
			-- Each value is a table identifying any country codes that are
			-- displayed only if simple=yes.
			main = { EH = true, },
		},
	},
	lists = {
		-- List of countries in an order suitable for display in the specified language.
		main = {
			english     = 'automatic', -- this applies with uselang=en
			default     = 'automatic sorted', -- currently unused because en is defined
			en          = 'automatic sorted', -- this applies with uselang=XX where XX is not defined here
			automatic   = 'DZ AO BJ BW BF BI CM CV CF TD KM CD CG DJ EG GQ ER SZ ET GA GM GH GN GW CI KE LS LR LY MG MW ML MR MU MA MZ NA NE NG RW ST SN SC SL SO ZA SS SD TZ TG TN UG ZM ZW',
			de          = 'EG DZ AO GQ ET BJ BW BF BI DJ CI ER SZ GA GM GH GN GW CM CV KE KM CD CG LS LR LY MG MW ML MA MR MU MZ NA NE NG RW ZM ST SN SC SL ZW SO ZA SD SS TZ TG TD TN UG CF',
			fr          = 'ZA DZ AO BJ BW BF BI CM CV KM CI DJ EG ER SZ ET GA GM GH GN GQ GW KE LS LR LY MG MW ML MR MU MA MZ NA NE NG UG CF CD CG RW ST SN SC SL SO SD SS TZ TD TG TN ZM ZW',
			mk          = 'DZ AO BJ BW BF BI CM CV CF TD KM CI CD DJ EG GQ ER ET GA GM GH GN GW KE LS LR LY MG MW ML MR MU MA MZ NA NE NG CG RW ST SN SC SL SO SS ZA SD SZ TZ TG TN UG ZM ZW',
			nb          = 'DZ AO BJ BW BF BI DJ EG GQ CI ER SZ ET GA GM GH GN GW CM CV KE KM CD CG LS LR LY MG MW ML MA MR MU MZ NA NE NG RW ST SN CF SC SL SO SD ZA SS TZ TG TD TN UG ZM ZW',
			nn          = 'DZ AO BJ BW BF BI DJ EG GQ CI ER SZ ET GA GM GH GN GW CM CV KE KM CD CG LS LR LY MG MW ML MA MR MU MZ NA NE NG RW ST SN CF SC SL SO SD ZA SS TZ TG TD TN UG ZM ZW',
			no          = 'DZ AO BJ BW BF BI DJ EG GQ CI ER SZ ET GA GM GH GN GW CM CV KE KM CD CG LS LR LY MG MW ML MA MR MU MZ NA NE NG RW ST SN CF SC SL SO SD ZA SS TZ TG TD TN UG ZM ZW',
			uk          = 'DZ AO BJ BW BF BI GA GM GH GN GW DJ GQ ER ET EG ZM ZW CV CM KE KM CD CG CI LS LR LY MU MR MG MW ML MA MZ NA NE NG SS ZA RW ST SZ SC SN SO SD SL TZ TG TN UG CF TD',
			['zh-hans'] = 'DZ EG ET AO BJ BW BF BI GQ TG ER CV GM CG CD GH GA DJ GN GW ZW CM KM CI KE LS LR LY RW MG MW ML MU MR MA MZ NA ZA SS NE NG SL SN SC ST SZ SD SO TZ TN UG ZM TD CF',
			['zh-hant'] = 'DZ EG AO BJ BW BF TD GQ TG ER CG CD GM KM GH GA DJ GN GW CM KE LR LS LY RW MG MW ML MR MU MA MZ NA NG ZA SS NE BI SN SC ZM ST SZ SL SD SO TZ TN CV UG CI ZW ET CF',
			['zh-hk']   = 'DZ EG ET AO BJ BW BF BI GQ TG ER CV GM CG CD GH GA DJ GN GW ZW CM KM CI KE LS LR LY MG MW ML MU MR MA MZ NA ZA SS NE NG RW SL SN SC ST SZ SO SD TZ TN UG ZM TD CF',
			['zh-sg']   = 'DZ EG ET AO BJ BW BF BI GQ TG ER CV GM CG CD GH GA DJ GN GW ZW CM KM KE LS LR LY MG MW ML MU MR MA MZ NA ZA SS NE NG RW SL SN SC ST SZ SO SD TZ TN UG CI ZM TD CF',
		},
		limited = {
			english     = 'automatic', -- this applies with uselang=en
			default     = 'automatic sorted', -- currently unused because en is defined
			en          = 'automatic sorted', -- this applies with uselang=XX where XX is not defined here
			de          = 'CMXAM MLXAW EHXSA SOXPL SOXSL',
			nb          = 'CMXAM MLXAW SOXPL EHXSA SOXSL',
			nn          = 'CMXAM MLXAW SOXPL EHXSA SOXSL',
			no          = 'CMXAM MLXAW SOXPL EHXSA SOXSL',
			['zh-hans'] = 'EHXSA MLXAW SOXPL SOXSL CMXAM',
			['zh-hant'] = 'MLXAW SOXPL EHXSA SOXSL CMXAM',
			['zh-hk']   = 'EHXSA MLXAW SOXPL SOXSL CMXAM',
			['zh-sg']   = 'MLXAW SOXPL EHXSA SOXSL CMXAM',
			automatic   = 'CMXAM MLXAW SOXPL EHXSA SOXSL',
		},
		other = {
			english     = 'automatic', -- this applies with uselang=en
			default     = 'automatic sorted', -- currently unused because en is defined
			en          = 'automatic sorted', -- this applies with uselang=XX where XX is not defined here
			de          = 'XBRTW ESCE TFXEP ESCN PTMA YT ESML RE SH EH',
			fr          = 'XBRTW ESCN ESCE TFXEP PTMA YT ESML RE EH SH',
			nb          = 'XBRTW ESCE TFXEP ESCN PTMA YT ESML RE SH EH',
			nn          = 'XBRTW ESCE TFXEP ESCN PTMA YT ESML RE SH EH',
			no          = 'XBRTW ESCE TFXEP ESCN PTMA YT ESML RE SH EH',
			uk          = 'XBRTW EH ESCN PTMA YT ESML RE TFXEP SH ESCE',
			['zh-hans'] = 'XBRTW TFXEP RE ESCN YT ESML PTMA SH EH ESCE',
			['zh-hant'] = 'XBRTW TFXEP RE ESCN YT ESML PTMA SH EH ESCE',
			['zh-hk']   = 'XBRTW TFXEP RE ESCN YT ESML PTMA SH EH ESCE',
			['zh-sg']   = 'XBRTW TFXEP RE ESCN YT ESML PTMA SH EH ESCE',
			automatic   = 'XBRTW ESCN ESCE PTMA YT ESML RE SH TFXEP EH',
		},
		partly = {
			-- Not rendered as a list, conditionally rendered as a note (marked by '‡') after each country (see pattern).
			-- So no need to sort the list for each language, just ordered by code here
			default       = 'automatic',
			automatic     = 'EG FRXOV TF', -- DO NOT SORT THIS BY NAME
		},
	},
	countries = {
		-- All 2-letter codes come from ISO3166-1; codes ESCE, ESCN, ESML are standard extensions from ISO3166-2;
		-- codes CMXAM, EHXSA, MLXAW, SOXSL, SOXPL, TFXEP, XBRTW are invented extensions of ISO3166-1.
		AO    = { 'Angola',                                       qid = 'Q916', },
		BF    = { 'Burkina Faso',                                 qid = 'Q965', },
		BI    = { 'Burundi',                                      qid = 'Q967', },
		BJ    = { 'Benin',                                        qid = 'Q962', },
		BW    = { 'Botswana',                                     qid = 'Q963', },
		CD    = { 'Democratic Republic of the Congo',
		          'Congo-Kinshasa',                               qid = 'Q974', the = true, fop = 'Democratic Republic of the Congo', },
		CF    = { 'Central African Republic',                     qid = 'Q929', the = true, },
		CG    = { 'Republic of the Congo',
		          'Congo-Brazzaville',                            qid = 'Q971', the = true, fop = 'Republic of the Congo', },
		CI    = { 'Ivory Coast',
		          "Côte d'Ivoire",                                qid = 'Q1008', },
		CM    = { 'Cameroon',                                     qid = 'Q1009', },
		CMXAM = { 'Ambazonia',                                    qid = 'Q2842000', },
		CV    = { 'Cape Verde',                                   qid = 'Q1011', },
		DJ    = { 'Djibouti',                                     qid = 'Q977', },
		DZ    = { 'Algeria',                                      qid = 'Q262', },
		EG    = { 'Egypt',                                        qid = 'Q79', mark = '‡', },
		EH    = { 'Western Sahara',                               qid = 'Q6250', },
		EHXSA = { 'Sahrawi Arab Democratic Republic',             qid = 'Q40362', the = true, },
		ER    = { 'Eritrea',                                      qid = 'Q986', },
		ESCE  = { 'Ceuta',                                        qid = 'Q5823', },
		ESCN  = { 'Canary Islands',                               qid = 'Q5813', the = true, },
		ESML  = { 'Melilla',                                      qid = 'Q5831', },
		ET    = { 'Ethiopia',                                     qid = 'Q115', },
		FRXOV = { 'Overseas France',                              qid = 'Q203396', },
		GA    = { 'Gabon',                                        qid = 'Q1000', },
		GH    = { 'Ghana',                                        qid = 'Q117', },
		GM    = { 'Gambia',                                       qid = 'Q1005', the = true, },
		GN    = { 'Guinea',                                       qid = 'Q1006', },
		GQ    = { 'Equatorial Guinea',                            qid = 'Q983', },
		GW    = { 'Guinea-Bissau',                                qid = 'Q1007', },
		KE    = { 'Kenya',                                        qid = 'Q114', },
		KM    = { 'Comoros',                                      qid = 'Q970', the = true, },
		LR    = { 'Liberia',                                      qid = 'Q1014', },
		LS    = { 'Lesotho',                                      qid = 'Q1013', },
		LY    = { 'Libya',                                        qid = 'Q1016', },
		MA    = { 'Morocco',                                      qid = 'Q1028', },
		MG    = { 'Madagascar',                                   qid = 'Q1019', },
		ML    = { 'Mali',                                         qid = 'Q912', },
		MLXAW = { 'Azawad',                                       qid = 'Q43937', },
		MR    = { 'Mauritania',                                   qid = 'Q1025', },
		MU    = { 'Mauritius',                                    qid = 'Q1027', },
		MW    = { 'Malawi',                                       qid = 'Q1020', },
		MZ    = { 'Mozambique',                                   qid = 'Q1029', },
		NA    = { 'Namibia',                                      qid = 'Q1030', },
		NE    = { 'Niger',                                        qid = 'Q1032', },
		NG    = { 'Nigeria',                                      qid = 'Q1033', },
		PTMA  = { 'Madeira',                                      qid = 'Q26253', },
		RE    = { 'Réunion',                                      qid = 'Q17070', },
		RW    = { 'Rwanda',                                       qid = 'Q1037', },
		SC    = { 'Seychelles',                                   qid = 'Q1042', the = true, },
		SD    = { 'Sudan',                                        qid = 'Q1049', },
		SH    = { 'Saint Helena, Ascension and Tristan da Cunha', qid = 'Q192184', },
		SL    = { 'Sierra Leone',                                 qid = 'Q1044', },
		SN    = { 'Senegal',                                      qid = 'Q1041', },
		SO    = { 'Somalia',                                      qid = 'Q1045', },
		SOXSL = { 'Somaliland',                                   qid = 'Q34754', },
		SOXPL = { 'Puntland',                                     qid = 'Q485112', },
		SS    = { 'South Sudan',                                  qid = 'Q958', },
		ST    = { 'São Tomé and Príncipe',                        qid = 'Q1039', },
		SZ    = { 'Eswatini',									  qid = 'Q1050', },
		TD    = { 'Chad',                                         qid = 'Q657', },
		TF    = { 'French Southern and Antarctic Lands',          qid = 'Q129003', the = true, },
		TFXEP = { 'Scattered Islands in the Indian Ocean',        qid = 'Q190571', the = true, },
		TG    = { 'Togo',                                         qid = 'Q945', },
		TN    = { 'Tunisia',                                      qid = 'Q948', },
		TZ    = { 'Tanzania',                                     qid = 'Q924', },
		UG    = { 'Uganda',                                       qid = 'Q1036', },
		XBRTW = { 'Bir Tawil',                                    qid = 'Q620634', },
		YT    = { 'Mayotte',                                      qid = 'Q17063', },
		ZA    = { 'South Africa',                                 qid = 'Q258', },
		ZM    = { 'Zambia',                                       qid = 'Q953', },
		ZW    = { 'Zimbabwe',                                     qid = 'Q954', },
	},
}