มอดูล:Citation/CS1/Configuration/sandbox

local lang_obj = mw.language.getContentLanguage();								-- make a language object for the local language; used here for languages and dates 
------------------------------------------------------------------------------------------
boolean settings used to control various things.  these setting located here to make them easy to find
																				-- these settings local to this module only
local local_digits_from_mediawiki = false;										-- for i18n; when true, module fills date_names'local_digits' from MediaWiki; manual fill required else; always false at en.wiki
local local_date_names_from_mediawiki = false;									-- for i18n; when true, module fills date_names'locallong' and date_names'localshort' from MediaWiki;
																				-- manual translation required else; ; always false at en.wiki
																				-- these settings exported to other modules
local use_identifier_redirects = true;											-- when true use redirect name for identifier label links; always true at en.wiki
local local_lang_cat_enable = false;											-- when true categorizes pages where |language=; always false at en.wiki
local date_name_auto_xlate_enable = false;										-- when true translates English month-names to the local-wiki's language month names; always false at en.wiki
local date_digit_auto_xlate_enable = false;										-- when true translates Western date digit to the local-wiki's language digits (date_names'local_digits'); always false at en.wiki
----------------------------------------------------------
List of namespaces identifiers for namespaces that will not be included in citation error categories.
Same as setting notracking = true by default.
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered
list of namespace names and their associated identifiers:
	all=
uncategorized_namespaces_t = {2=true};										-- init with user namespace id
for k, _ in pairs (mw.site.talkNamespaces) do									-- add all talk namespace ids
	uncategorized_namespaces_tk = true;
end
local uncategorized_subpages = {'/Ssandbox', '/Ttestcases', '/^/*Llog', '/Aarchive'};		-- list of Lua patterns found in page names of pages we should not categorize
------------------------------------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
local messages = {
	'agency' = '$1 $2',														-- $1 is sepc, $2 is agency
	'archived-dead' = 'คลังข้อมูลเก่าเก็บจาก$1เมื่อ $2',
	'archived-live' = '$1จากแหล่งเดิมเมื่อ $2',
	'archived-unfit' = 'คลังข้อมูลเก่าเก็บจากแหล่งเดิมเมื่อ ',
	'archived' = 'เก็บ',
	'by' = 'โดย',																-- contributions to authored works: introduction, foreword, afterword
	'cartography' = 'การทำแผนที่โดย $1',
	'editor' = 'บ.ก.',
	'editors' = 'บ.ก.',
	'edition' = '($1 ed.)',
	'episode' = 'ตอน $1',
	'et al' = 'และคณะ',
	'in' = 'ใน',																-- edited works
	'inactive' = 'inactive',
	'inset' = '$1 inset',
	'interview' = 'สัมภาษณ์โดย $1',
	'mismatch' = '|$1= / |$2= ไม่ตรงกัน',	-- $1 is year param name; $2 is date param name
	'newsgroup' = 'Newsgroup: $1',
	'notitle' = 'ไม่มีชื่อ',													-- for |title=(()) and (in the future) |title=none
	'original' = 'แหล่งเดิม',
	'origdate' = ' $1',
	'published' = ' (ตีพิมพ์ $1)',
	'retrieved' = 'สืบค้นเมื่อ $1',
	'season' = 'ฤดูกาล $1',
	'section' = '§ $1',
	'sections' = '§§ $1',
	'series' = '$1 $2',														-- $1 is sepc, $2 is series
	'seriesnum' = 'Series $1',
	'translated' = 'แปลโดย $1',
	'type' = ' ($1)',															-- for titletype
	'written' = 'Written at $1',
	'vol' = '$1 Vol. $2',												-- $1 is sepc; bold journal style volume is in presentation{}
	'vol-no' = '$1 Vol. $2, no. $3',								-- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
	'issue' = '$1 No. $2',												-- $1 is sepc
	'art' = '$1 Art. $2',												-- $1 is sepc; for  only
	'vol-art' = '$1 Vol. $2, art. $3',								-- sepc, volume, article-number; for  only
	'j-vol' = '$1 $2',														-- sepc, volume; bold journal volume is in presentation{}
	'j-issue' = ' ($1)',
	'j-article-num' = ' $1',													-- TODO: any punctuation here? static text?
	'nopp' = '$1 $2';															-- page(s) without prefix; $1 is sepc
	'p-prefix' = "$1 p. $2",												-- $1 is sepc
	'pp-prefix' = "$1 pp. $2",											-- $1 is sepc
	'j-page(s)' = ': $1',														-- same for page and pages
	'sheet' = '$1 Sheet $2',												-- $1 is sepc
	'sheets' = '$1 Sheets $2',											-- $1 is sepc
	'j-sheet' = ': Sheet $1',
	'j-sheets' = ': Sheets $1',
	
	'language' = '(ภาษา$1)',
	'via' = " – โดยทาง $1",
	'event' = 'เหตุการณ์เกิดขึ้นที่',
	'minutes' = 'นาที',
	
	-- Determines the location of the help page
	'help page link' = 'Help:CS1 errors',
	'help page label' = 'help',
	
	-- categories
	'cat wikilink' = 'หมวดหมู่:$1',										-- $1 is the category name
	':cat wikilink' = 'ลิงก์',								-- category name as maintenance message wikilink; $1 is the category name
	-- Internal errors (should only occur if configuration is bad)
	'undefined_error' = 'Called with an undefined error condition',
	'unknown_ID_key' = 'Unrecognized ID key: ',								-- an ID key in id_handlers not found in ~/Identifiers func_map{}
	'unknown_ID_access' = 'Unrecognized ID access keyword: ',					-- an ID access keyword in id_handlers not found in keywords_lists'id-access'{}
	'unknown_argument_map' = 'Argument map not defined for this variable',
	'bare_url_no_origin' = 'Bare URL found but origin indicator is nil or empty',
	
	'warning_msg_e' = 'แม่แบบ  อย่างน้อยหนึ่งรายการมีข้อผิดพลาด ข้อความอาจถูกซ่อน (help).';	-- $1 is template link
	'warning_msg_m' = 'แม่แบบ  อย่างน้อยหนึ่งรายการมีข้อความบำรุงรักษา ข้อความอาจถูกซ่อน (help).';	-- $1 is template link
	}
--CitationClass= values at en.wiki match their canonical template names so are not listed here.
	local citation_class_map_t = {												-- TODO: if kept, these and all other config.CitationClass 'names' require some sort of i18n
		'arxiv' = 'arXiv',
		'audio-visual' = 'AV media',
		'AV-media-notes' = 'AV media notes',
		'biorxiv' = 'bioRxiv',
		'citeseerx' = 'CiteSeerX',
		'encyclopaedia' = 'encyclopedia',
		'mailinglist' = 'mailing list',
		'medrxiv' = 'medRxiv',
		'pressrelease' = 'press release',
		'ssrn' = 'SSRN',
		'techreport' = 'tech report',
		}
--=---------------------------------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
**
local et_al_patterns = {
	";,? *\"'*%f%aEeTt%.? *AaLl%.;,\"'*$",						-- variations on the 'et al' theme
	";,? *\"'*%f%aEeTt%.? *AaLlIiAaIiEe?%.;,\"'*$",		-- variations on the 'et alia', 'et alii' and 'et aliae' themes (false positive 'et aliie' unlikely to match)
	";,? *%f%aand Oothers",												-- an alternative to et al.
	"%% *EeTt%.? *AaLl%.? *%%",										-- a wikilinked form
	"%(%( *EeTt%.? *AaLl%.? *%)%)",										-- a double-bracketed form (to counter partial removal of ((...)) syntax)
	"%(% *EeTt%.? *AaLl%.? *%)%",									-- a bracketed form
	}
----------------------------------------------------
Fixed presentation markup.  Originally part of citation_config.messages it has
been moved into its own, more semantically correct place.
local presentation = 
	{
	-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
	'hidden-error' = '$1',
	'visible-error' = '$1',
	'hidden-maint' = '$1',
	
	'accessdate' = '$1$2',			-- to allow editors to hide accessdate using personal CSS
	'bdi' = '$2',												-- bidirectional isolation used with |script-title= and the like
	'cite' = '$2';									-- for use when citation does not have a namelist and |ref= not set so no id="..." attribute
	'cite-id' = '$3';							-- for use when when |ref= is set or when citation has a namelist
	'format' = ' ($1)',						-- for |format=, |chapter-format=, etc.
	'interwiki' = ' in $1',					-- for interwiki-language-linked author, editor, etc
	'interproj' = ' at $1',					-- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)
	-- various access levels, for |access=, |doi-access=, |arxiv=, ...
	-- narrow no-break space   may work better than nowrap CSS. Or not? Browser support?
	'ext-link-access-signal' = '$3',		-- external link with appropriate lock icon
		'free' = {class='cs1-lock-free', title='เข้าถึงได้ฟรี'},			-- classes defined in Module:Citation/CS1/styles.css
		'registration' = {class='cs1-lock-registration', title='ต้องสมัครสมาชิกแบบฟรี'},
		'limited' = {class='cs1-lock-limited', title='เข้าใช้ฟรีภายใต้การทดลองใช้แบบจำกัด ปกติต้องสมัครสมาชิก'},
		'subscription' = {class='cs1-lock-subscription', title='ต้องสมัครสมาชิกแบบชำระเงิน'},
	'interwiki-icon' = '$3',
		'class-wikisource' = 'cs1-ws-icon',
	'italic-title' = "$1",
	'kern-left' = '$1',					-- spacing to use when title contains leading single or double quote mark
	'kern-right' = '$1',					-- spacing to use when title contains trailing single or double quote mark
	'nowrap1' = '$1',								-- for nowrapping an item: yyyy-mm-dd
	'nowrap2' = '$1 $2',							-- for nowrapping portions of an item: dd mmmm yyyy (note white space)
	'ocins' = ,
	
	'parameter' = '|$1=',
	
	'ps_cs1' = '.';															-- CS1 style postscript (terminal) character
	'ps_cs2' = ;															-- CS2 style postscript (terminal) character (empty string)
	'quoted-text' = '$1',												-- for wrapping |quote= content
	'quoted-title' = '"$1"',
	'sep_cs1' = '.',															-- CS1 element separator
	'sep_cs2' = ',',															-- CS2 separator
	'sep_nl' = ';',															-- CS1|2 style name-list separator between names is a semicolon
	'sep_nl_and' = ' และ ',													-- used as last nl sep when |name-list-style=and and list has 2 items
	'sep_nl_end' = ' และ ',													-- used as last nl sep when |name-list-style=and and list has 3+ names
	'sep_name' = ', ',														-- CS1|2 style last/first separator is 
	'sep_nl_vanc' = ',',														-- Vancouver style name-list separator between authors is a comma
	'sep_name_vanc' = ' ',													-- Vancouver style last/first separator is a space
	'sep_list' = ', ',														-- used for |language= when list has 3+ items except for last sep which uses sep_list_end
	'sep_list_pair' = ' และ ',												-- used for |language= when list has 2 items
	'sep_list_end' = ' และ ',												-- used as last list sep for |language= when list has 3+ items
	
	'trans-italic-title' = "$1",
	'trans-quoted-title' = "$1",									-- for |trans-title= and |trans-quote=
	'vol-bold' = '$1 $2',												-- sepc, volume; for bold journal cites; for other cites 'vol' in messages{}
	}
	
-------------------------------------------------------------
Aliases table for commonly passed parameters.
Parameter names on the right side in the assignments in this table must have been
defined in the Whitelist before they will be recognized as valid parameter names
local aliases = {
	'AccessDate' = {'access-date', 'accessdate'},								-- Used by InternetArchiveBot
	'Agency' = 'agency',
	'ArchiveDate' = {'archive-date', 'archivedate'},							-- Used by InternetArchiveBot
	'ArchiveFormat' = 'archive-format',
	'ArchiveURL' = {'archive-url', 'archiveurl'},								-- Used by InternetArchiveBot
	'ArticleNumber' = 'article-number',
	'ASINTLD' = 'asin-tld',
	'At' = 'at',																-- Used by InternetArchiveBot
	'Authors' = {'authors', 'people', 'credits'},
	'BookTitle' = {'book-title', 'booktitle'},
	'Cartography' = 'cartography',
	'Chapter' = {'chapter', 'contribution', 'entry', 'article', 'section'},
	'ChapterFormat' = {'chapter-format', 'contribution-format', 'entry-format',
		'article-format', 'section-format'};
	'ChapterURL' = {'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url', 'chapterurl'},	-- Used by InternetArchiveBot
	'ChapterUrlAccess' = {'chapter-url-access', 'contribution-url-access',
		'entry-url-access', 'article-url-access', 'section-url-access'},		-- Used by InternetArchiveBot
	'Class' = 'class',														-- cite arxiv and arxiv identifier
	'Collaboration' = 'collaboration',
	'Conference' = {'conference', 'event'},
	'ConferenceFormat' = 'conference-format',
	'ConferenceURL' = 'conference-url',										-- Used by InternetArchiveBot
	'Date' = {'date', 'air-date', 'airdate'},									-- air-date and airdate for cite episode and cite serial only
	'Degree' = 'degree',
	'DF' = 'df',
	'DisplayAuthors' = {'display-authors', 'display-subjects'},
	'DisplayContributors' = 'display-contributors',
	'DisplayEditors' = 'display-editors',
	'DisplayInterviewers' = 'display-interviewers',
	'DisplayTranslators' = 'display-translators',
	'Docket' = 'docket',
	'DoiBroken' = 'doi-broken-date',
	'Edition' = 'edition',
	'Embargo' = 'pmc-embargo-date',
	'Encyclopedia' = {'encyclopedia', 'encyclopaedia', 'dictionary'},			-- cite encyclopedia only
	'Episode' = 'episode',													-- cite serial only TODO: make available to cite episode?
	'Format' = 'format',
	'ID' = {'id', 'ID'},
	'Inset' = 'inset',
	'Issue' = {'issue', 'number'},
	'Language' = {'language', 'lang'},
	'MailingList' = {'mailing-list', 'mailinglist'},							-- cite mailing list only
	'Map' = 'map',															-- cite map only
	'MapFormat' = 'map-format',												-- cite map only
	'MapURL' = {'map-url', 'mapurl'},											-- cite map only -- Used by InternetArchiveBot
	'MapUrlAccess' = 'map-url-access',										-- cite map only -- Used by InternetArchiveBot
	'Minutes' = 'minutes',
	'Mode' = 'mode',
	'NameListStyle' = 'name-list-style',
	'Network' = 'network',
	'Newsgroup' = 'newsgroup',												-- cite newsgroup only
	'NoPP' = {'no-pp', 'nopp'},
	'NoTracking' = {'no-tracking', 'template-doc-demo'},
	'Number' = 'number',														-- this case only for cite techreport
	'OrigDate' = {'orig-date', 'orig-year', 'origyear'},
	'Others' = 'others',
	'Page' = {'page', 'p'},													-- Used by InternetArchiveBot
	'Pages' = {'pages', 'pp'},												-- Used by InternetArchiveBot
	'Periodical' = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work'},
	'Place' = {'place', 'location'},
	'PostScript' = 'postscript',
	'PublicationDate' = {'publication-date', 'publicationdate'},
	'PublicationPlace' = {'publication-place', 'publicationplace'},
	'PublisherName' = {'publisher', 'institution'},
	'Quote' = {'quote', 'quotation'},
	'QuotePage' = 'quote-page',
	'QuotePages' = 'quote-pages',
	'Ref' = 'ref',
	'Scale' = 'scale',
	'ScriptChapter' = {'script-chapter', 'script-contribution', 'script-entry',
		'script-article', 'script-section'},
	'ScriptMap' = 'script-map',
	'ScriptPeriodical' = {'script-journal', 'script-magazine', 'script-newspaper',
		'script-periodical', 'script-website', 'script-work'},
	'ScriptQuote' = 'script-quote',
	'ScriptTitle' = 'script-title',											-- Used by InternetArchiveBot
	'Season' = 'season',
	'Sections' = 'sections',													-- cite map only
	'Series' = {'series', 'version'},
	'SeriesLink' = {'series-link', 'serieslink'},
	'SeriesNumber' = {'series-number', 'series-no'},
	'Sheet' = 'sheet',														-- cite map only
	'Sheets' = 'sheets',														-- cite map only
	'Station' = 'station',
	'Time' = 'time',
	'TimeCaption' = 'time-caption',
	'Title' = 'title',														-- Used by InternetArchiveBot
	'TitleLink' = {'title-link', 'episode-link', 'episodelink'},				-- Used by InternetArchiveBot
	'TitleNote' = {'title-note', 'department'},
	'TitleType' = {'type', 'medium'},
	'TransChapter' = {'trans-article', 'trans-chapter', 'trans-contribution',
		'trans-entry', 'trans-section'},
	'Transcript' = 'transcript',
	'TranscriptFormat' = 'transcript-format',	
	'TranscriptURL' = 'transcript-url',										-- Used by InternetArchiveBot
	'TransMap' = 'trans-map',													-- cite map only
	'TransPeriodical' = {'trans-journal', 'trans-magazine', 'trans-newspaper',
		'trans-periodical', 'trans-website', 'trans-work'},
	'TransQuote' = 'trans-quote',
	'TransTitle' = 'trans-title',												-- Used by InternetArchiveBot
	'URL' = {'url', 'URL'},													-- Used by InternetArchiveBot
	'UrlAccess' = 'url-access',												-- Used by InternetArchiveBot
	'UrlStatus' = 'url-status',												-- Used by InternetArchiveBot
	'Vauthors' = 'vauthors',
	'Veditors' = 'veditors',
	'Via' = 'via',
	'Volume' = 'volume',
	'Year' = 'year',
	'AuthorList-First' = {"first#", "author-first#", "author#-first", "author-given#", "author#-given",
		"subject-first#", "subject#-first", "subject-given#", "subject#-given",
		"given#"},
	'AuthorList-Last' = {"last#", "author-last#", "author#-last", "author-surname#", "author#-surname",
		"subject-last#", "subject#-last", "subject-surname#", "subject#-surname",
		"author#", 'host#', "subject#", "surname#"},
	'AuthorList-Link' = {"author-link#", "author#-link", "subject-link#",
		"subject#-link", "authorlink#", "author#link"},
	'AuthorList-Mask' = {"author-mask#", "author#-mask", "subject-mask#", "subject#-mask"},
	'ContributorList-First' = {'contributor-first#', 'contributor#-first',
		'contributor-given#', 'contributor#-given'},
	'ContributorList-Last' = {'contributor-last#', 'contributor#-last',
		'contributor-surname#', 'contributor#-surname', 'contributor#'},
	'ContributorList-Link' = {'contributor-link#', 'contributor#-link'},
	'ContributorList-Mask' = {'contributor-mask#', 'contributor#-mask'},
	'EditorList-First' = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
	'EditorList-Last' = {"editor-last#", "editor#-last", "editor-surname#",
		"editor#-surname", "editor#"},
	'EditorList-Link' = {"editor-link#", "editor#-link"},
	'EditorList-Mask' = {"editor-mask#", "editor#-mask"},
	
	'InterviewerList-First' = {'interviewer-first#', 'interviewer#-first',
		'interviewer-given#', 'interviewer#-given'},
	'InterviewerList-Last' = {'interviewer-last#', 'interviewer#-last',
		'interviewer-surname#', 'interviewer#-surname', 'interviewer#'},
	'InterviewerList-Link' = {'interviewer-link#', 'interviewer#-link'},
	'InterviewerList-Mask' = {'interviewer-mask#', 'interviewer#-mask'},
	'TranslatorList-First' = {'translator-first#', 'translator#-first',
		'translator-given#', 'translator#-given'},
	'TranslatorList-Last' = {'translator-last#', 'translator#-last',
		'translator-surname#', 'translator#-surname', 'translator#'},
	'TranslatorList-Link' = {'translator-link#', 'translator#-link'},
	'TranslatorList-Mask' = {'translator-mask#', 'translator#-mask'},
	}
-------------------------------------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
local punct_meta_params = {														-- table of aliases keys (meta parameters); each key has a table of parameter names for a value
	'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap',	'TransTitle',	-- title-holding parameters
	'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask',	-- name-list mask may have name separators
	'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref',											-- miscellaneous
	'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'MapURL', 'TranscriptURL', 'URL',						-- URL-holding parameters
	}
local url_meta_params = {														-- table of aliases keys (meta parameters); each key has a table of parameter names for a value
	'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'ID', 'MapURL', 'TranscriptURL', 'URL',		-- parameters allowed to hold urls
	'Page', 'Pages', 'At', 'QuotePage', 'QuotePages',							-- insource locators allowed to hold urls
	}
local function build_skip_table (skip_t, meta_params)
	for _, meta_param in ipairs (meta_params) do								-- for each meta parameter key
		local params = aliasesmeta_param;										-- get the parameter or the table of parameters associated with the meta parameter name
		if 'string' == type (params) then
			skip_tparams = 1;													-- just a single parameter
		else
			for _, param in ipairs (params) do									-- get the parameter name
				skip_tparam = 1;												-- add the parameter name to the skip table
				local count;
				param, count = param:gsub ('#', );							-- remove enumerator marker from enumerated parameters
				if 0 ~= count then												-- if removed
					skip_tparam = 1;											-- add param name without enumerator marker
				end
			end
		end
	end
	return skip_t;
end
local punct_skip = {};
local url_skip = {};
--------------------------------------
this is a list of tlds that are known to have single-letter second-level domain names.  This list does not include
ccTLDs which are accepted in is_domain_name().
local single_letter_2nd_lvl_domains_t = {'cash', 'company', 'foundation', 'org', 'today'};
-------------------------
This table is primarily here to support internationalization.  Translations in
this table are used, for example, when an error message, category name, etc.,
is extracted from the English alias key.  There may be other cases where
this translation table may be useful.
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143';
local special_case_translation = {
	'AuthorList' = 'authors list',											-- used to assemble maintenance category names
	'ContributorList' = 'contributors list',									-- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
	'EditorList' = 'editors list',											-- must match the names of the actual categories
	'InterviewerList' = 'interviewers list',									-- this group or translations used by name_has_ed_markup() and name_has_mult_names()
	'TranslatorList' = 'translators list',
	
																				-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value
	'archived_copy' = {														-- used with CS1 maint: Archived copy as title
		'en' = '^archived?%s+copy$',											-- for English; translators: keep this because templates imported from en.wiki
		'local' = nil,														-- translators: replace 'local' = nil with lowercase translation only when bots or tools create generic titles in your language
		},
																				-- Lua patterns to match generic titles; usually created by bots or reference filling tools
																				-- translators: replace 'local' = nil with lowercase translation only when bots or tools create generic titles in your language
		-- generic titles and patterns in this table should be lowercase only
		-- leave 'local' nil except when there is a matching generic title in your language
		-- boolean 'true' for plain-text searches; 'false' for pattern searches
	'generic_titles' = {
		'accept' = {
			},
		'reject' = {
			{'en' = {'^wayback%s+machine$', false},				'local' = nil},
			{'en' = {'are you a robot', true},					'local' = nil},
			{'en' = {'hugedomains.com', true},					'local' = nil},
			{'en' = {'^%(%{}%%)?$', false},		'local' = nil},
			{'en' = {'page not found', true},						'local' = nil},
			{'en' = {'subscribe to read', true},					'local' = nil},
			{'en' = {'^%(%{}%%)?$', false},		'local' = nil},
			{'en' = {'website is for sale', true},				'local' = nil},
			{'en' = {'^404', false},								'local' = nil},
			{'en' = {'internet archive wayback machine', true},	'local' = nil},
			{'en' = {'log into facebook', true},					'local' = nil},
			{'en' = {'login • instagram', true},					'local' = nil},
			{'en' = {'redirecting...', true},						'local' = nil},
			{'en' = {'usurped title', true},						'local' = nil},	-- added by a GreenC bot
			{'en' = {'webcite query result', true},				'local' = nil},
			{'en' = {'wikiwix\'s cache', true},					'local' = nil},
			}
		},
		-- boolean 'true' for plain-text searches, search string must be lowercase only
		-- boolean 'false' for pattern searches
		-- leave 'local' nil except when there is a matching generic name in your language
	'generic_names' = {
		'accept' = {
			{'en' = {'%%*%(author%) *|^%*%%', false},				'local' = nil},
			},
		'reject' = {
			{'en' = {'about us', true},										'local' = nil},
			{'en' = {'%f%aAadvisor%f%A', false},						'local' = nil},
			{'en' = {'allmusic', true},										'local' = nil},
			{'en' = {'%f%aAauthor%f%A', false},							'local' = nil},
			{'en' = {'business', true},										'local' = nil},
			{'en' = {'cnn', true},											'local' = nil},
			{'en' = {'collaborator', true},									'local' = nil},
			{'en' = {'contributor', true},									'local' = nil},
			{'en' = {'contact us', true},										'local' = nil},
			{'en' = {'directory', true},										'local' = nil},
			{'en' = {'%f%(%%(%%s*eds?%.?%s*%)%?$', false},			'local' = nil},
			{'en' = {',%.%s%feeds?%.?$', false},							'local' = nil},
			{'en' = {'^eds?%.,;', false},									'local' = nil},
			{'en' = {'^%(%%s*EeDdSs?%.?%s*%)%', false},			'local' = nil},
			{'en' = {'%f%aEedited%f%A', false},							'local' = nil},
			{'en' = {'%f%aEeditors?%f%A', false},						'local' = nil},
			{'en' = {'%f%aEemail%f%A', false},							'local' = nil},
			{'en' = {'facebook', true},										'local' = nil},
			{'en' = {'google', true},											'local' = nil},
			{'en' = {'home page', true},										'local' = nil},
			{'en' = {'^Iinc%.?$', false},									'local' = nil},
			{'en' = {'instagram', true},										'local' = nil},
			{'en' = {'interviewer', true},									'local' = nil},
			{'en' = {'linkedIn', true},										'local' = nil},
			{'en' = {'^Nnews$', false},										'local' = nil},
			{'en' = {'pinterest', true},										'local' = nil},
			{'en' = {'policy', true},											'local' = nil},
			{'en' = {'privacy', true},										'local' = nil},
			{'en' = {'reuters', true},										'local' = nil},
			{'en' = {'translator', true},										'local' = nil},
			{'en' = {'tumblr', true},											'local' = nil},
			{'en' = {'twitter', true},										'local' = nil},
			{'en' = {'site name', true},										'local' = nil},
			{'en' = {'statement', true},										'local' = nil},
			{'en' = {'submitted', true},										'local' = nil},
			{'en' = {'super.?user', false},									'local' = nil},
			{'en' = {'%f'..is_Latn..'Uuser%f^'..is_Latn.., false},	'local' = nil},
			{'en' = {'verfasser', true},										'local' = nil},
			}
	}
	}
--------------------------------------------------------------------------------------
This table of tables lists local language date names and fallback English date names.
The code in Date_validation will look first in the local table for valid date names.
If date names are not found in the local table, the code will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is
required when the date-name translation function date_name_xlate() is used.
In these tables, season numbering is defined by
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019.  See '§Sub-year groupings'. The standard
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.
EDTF does support the distinction between north and south hemisphere seasons
but CS1|2 has no way to make that distinction.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
The standard does not address 'named' dates so, for the purposes of CS1|2,
Easter and Christmas are defined here as 98 and 99, which should be out of the
ISO 8601 (EDTF) range of uses for a while.
local_date_names_from_mediawiki is a boolean.  When set to:
	true – module will fetch local month names from MediaWiki for both date_names'locallong' and date_names'localshort'
	false – module will *not* fetch local month names from MediaWiki
Caveat lector:  There is no guarantee that MediaWiki will provide short month names.  At your wiki you can test
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):
	=mw.dumpObject (p.date_names'local')
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names
from MediaWiki.  Those must be translated manually.
local local_date_names_from_mediawiki = true;									-- when false, manual translation required for date_names'locallong' and date_names'localshort'
																				-- when true, module fetches long and short month names from MediaWiki
local date_names = {
	'en' = {																	-- English
		'long'	= {'January' = 1, 'February' = 2, 'March' = 3, 'April' = 4, 'May' = 5, 'June' = 6, 'July' = 7, 'August' = 8, 'September' = 9, 'October' = 10, 'November' = 11, 'December' = 12},
		'short'	= {'Jan' = 1, 'Feb' = 2, 'Mar' = 3, 'Apr' = 4, 'May' = 5, 'Jun' = 6, 'Jul' = 7, 'Aug' = 8, 'Sep' = 9, 'Oct' = 10, 'Nov' = 11, 'Dec' = 12},
		'quarter' = {'First Quarter' = 33, 'Second Quarter' = 34, 'Third Quarter' = 35, 'Fourth Quarter' = 36},
		'season'	= {'Winter' = 24, 'Spring' = 21, 'Summer' = 22, 'Fall' = 23, 'Autumn' = 23},
		'named'	= {'Easter' = 98, 'Christmas' = 99},
		},
																				-- when local_date_names_from_mediawiki = false
	'local' = {																-- replace these English date names with the local language equivalents
		'long'	= {'มกราคม' = 1, 'กุมภาพันธ์' = 2, 'มีนาคม' = 3, 'เมษายน' = 4, 'พฤษภาคม' = 5, 'มิถุนายน' = 6, 'กรกฎาคม' = 7, 'สิงหาคม' = 8, 'กันยายน' = 9, 'ตุลาคม' = 10, 'พฤศจิกายน' = 11, 'ธันวาคม' = 12},
		'short'	= {'ม.ค.' = 1, 'ก.พ.' = 2, 'มี.ค.' = 3, 'เม.ย.' = 4, 'พ.ค.' = 5, 'มิ.ย.' = 6, 'ก.ค.' = 7, 'ส.ค.' = 8, 'ก.ย.' = 9, 'ต.ค.' = 10, 'พ.ย.' = 11, 'ธ.ค.' = 12},
		'quarter' = {'ไตรมาสที่หนึ่ง' = 33, 'ไตรมาสที่สอง' = 34, 'ไตรมาสที่สาม' = 35, 'ไตรมาสที่สี่' = 36},
		'season'	= {'หนาว' = 24, 'ใบไม้ผลิ' = 21, 'ร้อน' = 22, 'ใบไม้ร่วง' = 23, 'ใบไม้ร่วง' = 23},
		'named'	= {'อีสเตอร์' = 98, 'คริสต์มาส' = 99},
		},
	'inv_local_long' = {},													-- used in date reformatting & translation; copy of date_names'local'.long where k/v are inverted: 1= etc.
	'inv_local_short' = {},													-- used in date reformatting & translation; copy of date_names'local'.short where k/v are inverted: 1= etc.
	'inv_local_quarter' = {},													-- used in date translation; copy of date_names'local'.quarter where k/v are inverted: 1= etc.
	'inv_local_season' = {},													-- used in date translation; copy of date_names'local'.season where k/v are inverted: 1= etc.
	'inv_local_named' = {},													-- used in date translation; copy of date_names'local'.named where k/v are inverted: 1= etc.
	'local_digits' = {'๐' = '0', '๑' = '1', '๒' = '2', '๓' = '3', '๔' = '4', '๕' = '5', '๖' = '6', '๗' = '7', '๘' = '8', '๙' = '9'},	-- used to convert local language digits to Western 0-9
	'xlate_digits' = {},
	}
if local_date_names_from_mediawiki then											-- if fetching local month names from MediaWiki is enabled
	local long_t = {};
	local short_t = {};
	for i=1, 12 do																-- loop 12x and 
		local name = lang_obj:formatDate('F', '2022-' .. i .. '-1');			-- get long month name for each i
		long_tname = i;														-- save it
		name = lang_obj:formatDate('M', '2022-' .. i .. '-1');					-- get short month name for each i
		short_tname = i;														-- save it
	end
	date_names'locallong' = long_t;										-- write the long table – overwrites manual translation
	date_names'localshort' = short_t;										-- write the short table – overwrites manual translation
end
																				-- create inverted date-name tables for reformatting and/or translation
for _, invert_t in pairs  do
	for name, i in pairs (date_names'local'invert_t1) do					-- this table is 'name' = i
		date_namesinvert_t2i = name;										-- invert to get i = 'name' for conversions from ymd
	end
end
if local_digits_from_mediawiki then												-- if fetching local digits from MediaWiki is enabled
	local digits_t = {};
	for i=0, 9 do																-- loop 10x and 
		digits_t lang_obj:formatNum (i) = tostring (i);						-- format the loop indexer as local lang table index and assign loop indexer (a string) as the value
	end
	date_names'local_digits' = digits_t;
end
for ld, ed in pairs (date_names.local_digits) do								-- make a digit translation table for simple date translation from en to local language using local_digits table
	date_names.xlate_digits ed = ld;											-- en digit becomes index with local digit as the value
end
local df_template_patterns = {													-- table of redirects to  and 
	'