Module:States of the United States/sandbox

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Lua

CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

Examples of use

[edit]
{{#invoke:Countries/sandbox|main|Module:States of the United States/sandbox|showcode=yes}}
  • {{States of the United States/sandbox|prefix=:Category:|showcode=yes}} gives:
  • {{States of the United States/sandbox|prefix=:Category:|showcode=}} gives:
  • {{States of the United States/sandbox|prefix=:Category:|all=1}} gives:

See also

[edit]


Code

--[=[
Data defining countries for {{#invoke:Countries|main|Module:States of the United States}}.

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.
Where XYZ must consist of en alphabetic characters [A-Za-z].
]=]
return {
	titles = {
		st = {
			de = "Bundesstaaten der Vereinigten Staaten",
			cs = "Státy Spojených států amerických",
			en = "States of the United States",
			es = "Estados de los Estados Unidos",
			fr = "États des États-Unis",
			hu = "Az Amerikai Egyesült Államok tagállamai",
			it = "Stati degli USA",
			ja = "アメリカ合衆国の州",
			mk = "Сојузни држави на САД",
			nb = "USAs delstater",
			nn = "USAs delstatar",
			no = "USAs delstater",
			pt = "Estados dos Estados Unidos",
			sl = "Zvezne države ZDA",
			uk = "Штати США",
			ru = "Штаты США",
			['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%">',
				'stlist',
				'DClist',
				'dclist',
				'XAlist',
				'xalist',
				'UMlist',
				'umlist',
		},

		{	'<em>{sttitle}{colon}</em>',
				{ 'sttitle', 'stlist', },
		},
			'{stlist}',

		{	'&nbsp;– ',
				{ 'sttitle', 'DClist', },
				{ 'sttitle', 'dclist', },
				{ 'stlist', 'DClist', },
				{ 'stlist', 'dclist', },
		},
		{	'<em>',
				'DClist',
				'dclist',
		},
			'{DClist}',
		{	'{colon}',
				{ 'DClist', 'dclist', }
		},
		{	'</em>',
				'DClist',
				'dclist',
		},
			'{dclist}',

		{	'<br /> ',
				{ 'stlist', 'XAlist', },
				{ 'stlist', 'xalist', },
				{ 'stlist', 'UMlist', },
				{ 'stlist', 'umlist', },
				{ 'DClist', 'XAlist', },
				{ 'DClist', 'xalist', },
				{ 'DClist', 'UMlist', },
				{ 'DClist', 'umlist', },
				{ 'dclist', 'XAlist', },
				{ 'dclist', 'xalist', },
				{ 'dclist', 'UMlist', },
				{ 'dclist', 'umlist', },
		},

		{	'<em>{XAlist}{colon}</em>',
				{ 'XAlist', 'xalist', },
		},
			'{xalist}',

		{	'&nbsp;– ',
				{ 'XAlist', 'UMlist', },
				{ 'XAlist', 'umlist', },
				{ 'xalist', 'UMlist', },
				{ 'xalist', 'umlist', },
		},
		{	'<em>',
				'UMlist',
				'umlist',
		},
			'{UMlist}',
		{	'{colon}',
				{ 'UMlist', 'umlist', },
		},
		{	'</em>',
				'UMlist',
				'umlist',
		},
			'{umlist}',

		{
			'</div></div>',
				'stlist',
				'DClist',
				'dclist',
				'XAlist',
				'xalist',
				'UMlist',
				'umlist',
		},
	},
	lists = {
		st = {
			english     = 'automatic sorted', -- 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   = 'AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY',
		},
		DC = {
			english     = 'automatic sorted', -- 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   = 'DC',
		},
		dc = {
			english     = 'automatic sorted', -- 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   = 'WD',
		},
		XA = {
			english     = 'automatic sorted', -- 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   = 'XA'
		},
		xa = {
			english     = 'automatic sorted', -- 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   = 'AS GU MP PR VI'
		},
		UM = {
			english     = 'automatic sorted', -- 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   = 'UM'
		},
		um = {
			english     = 'automatic sorted', -- 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   = 'QB XB XH XQ XU XM QM XV XL QS QW'
		},
	},
	infos = {
		AK = { "Alaska",                                           qid = 'Q797', },
		AL = { "Alabama",                                          qid = 'Q173', },
		AR = { "Arkansas",                                         qid = 'Q1612', },
		AS = { "American Samoa",                                   qid = 'Q16641', },
		AZ = { "Arizona",                                          qid = 'Q816', },
		CA = { "California",
		       "California (state)",                               qid = 'Q99', },
		CO = { "Colorado",                                         qid = 'Q1261', },
		CT = { "Connecticut",                                      qid = 'Q779', },
		DC = { "the District of Columbia",
		       "District of Columbia",                             qid = 'Q3551781', },
		DE = { "Delaware",                                         qid = 'Q1393', },
		FL = { "Florida",
		       "Florida (state)",                                  qid = 'Q812', },
		GA = { "Georgia (U.S. state)",                             qid = 'Q1428', },
		GU = { "Guam",                                             qid = 'Q16635', },
		HI = { "Hawaii",                                           qid = 'Q782', },
		IA = { "Iowa",                                             qid = 'Q1546', },
		ID = { "Idaho",                                            qid = 'Q1221', },
		IL = { "Illinois",                                         qid = 'Q1204', },
		IN = { "Indiana",                                          qid = 'Q1415', },
		KS = { "Kansas",                                           qid = 'Q1558', },
		KY = { "Kentucky",                                         qid = 'Q1603', },
		LA = { "Louisiana",                                        qid = 'Q1588', },
		MA = { "Massachusetts",                                    qid = 'Q771', },
		MD = { "Maryland",                                         qid = 'Q1391', },
		ME = { "Maine",                                            qid = 'Q724', },
		MI = { "Michigan",                                         qid = 'Q1166', },
		MN = { "Minnesota",                                        qid = 'Q1527', },
		MO = { "Missouri",                                         qid = 'Q1581', },
		MP = { "the Northern Mariana Islands",
		       "Northern Mariana Islands",                         qid = 'Q16644', },
		MS = { "Mississippi (state)",
		       "Mississippi",                                      qid = 'Q1494', },
		MT = { "Montana",                                          qid = 'Q1212', },
		NC = { "North Carolina",                                   qid = 'Q1454', },
		ND = { "North Dakota",                                     qid = 'Q1207', },
		NE = { "Nebraska",                                         qid = 'Q1553', },
		NH = { "New Hampshire",                                    qid = 'Q759', },
		NJ = { "New Jersey",                                       qid = 'Q1408', },
		NM = { "New Mexico",                                       qid = 'Q1522', },
		NV = { "Nevada",                                           qid = 'Q1227', },
		NY = { "New York (state)",
		       "New York",                                         qid = 'Q1384', },
		OH = { "Ohio",                                             qid = 'Q1397', },
		OK = { "Oklahoma",                                         qid = 'Q1649', },
		OR = { "Oregon",                                           qid = 'Q824', },
		PA = { "Pennsylvania",                                     qid = 'Q1400', },
		PR = { "Puerto Rico",                                      qid = 'Q1183', },
		QB = { "Bajo Nuevo Bank",                                  qid = 'Q1257783', },
		QM = { "Midway Atoll",
		       "Midway Islands",                                   qid = 'Q47863', },
		QS = { "Serranilla Bank",                                  qid = 'Q1169008', },
		QW = { "Wake Island",                                      qid = 'Q43296', },
		RI = { "Rhode Island",                                     qid = 'Q1387', },
		SC = { "South Carolina",                                   qid = 'Q1456', },
		SD = { "South Dakota",                                     qid = 'Q1211', },
		TN = { "Tennessee",                                        qid = 'Q1509', },
		TX = { "Texas",                                            qid = 'Q1439', },
		UM = { "the United States Minor Outlying Islands",
		       "United States Minor Outlying Islands",             qid = 'Q16645', },
		UT = { "Utah",                                             qid = 'Q829', },
		VA = { "Virginia",                                         qid = 'Q1370', },
		VI = { "the United States Virgin Islands",
		       "United States Virgin Islands",                     qid = 'Q11703', },
		VT = { "Vermont",                                          qid = 'Q16551', },
		WA = { "Washington (state)",
		       "Washington",                                       qid = 'Q1223', },
		WD = { "Washington, D.C.",                                 qid = 'Q61', },
		WI = { "Wisconsin",                                        qid = 'Q1537', },
		WV = { "West Virginia",                                    qid = 'Q1371', },
		WY = { "Wyoming",                                          qid = 'Q1214', },
		XA = { "the insular areas of the United States",
		       "insular areas of the United States",               qid = 'Q462778', },
		XB = { "Baker Island",                                     qid = 'Q46879', },
		XH = { "Howland Island",                                   qid = 'Q131305', },
		XQ = { "Jarvis Island",                                    qid = 'Q62218', },
		XU = { "Johnston Atoll",                                   qid = 'Q131008', },
		XM = { "Kingman Reef",                                     qid = 'Q130895', },
		XV = { "Navassa Island",                                   qid = 'Q25359', },
		XL = { "Palmyra Atoll",                                    qid = 'Q123076', },
	},
}