local lang_obj = mw.language.getContentLanguage; -- make a language object for the local language; used here for languages and dates  
----------------------------< S E T T I N G S >--------------------------------------------------------------  
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['local']['long'] and date_names['local']['short'] 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=<local wiki's 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
local enable_sort_keys = true; -- when true module adds namespace sort keys to error and maintenance category links  
----------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------  
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:  
local 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_t[k] = true;
end  
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases', '/[^/]*[Ll]og', '/[Aa]rchive'}; -- list of Lua patterns found in page names of pages we should not categorize  
--2 template on a page in that namespace.  
i18n: if this does not work well for your language, set <enable_sort_keys> to false.  
local name_space_sort_keys = { -- sort keys to be used with these namespaces:
[4] = 'ω', -- wikipedia; omega
[10] = 'τ', -- template; tau
[118] = 'Δ', -- draft; delta
['other'] = 'ο', -- all other non-talk namespaces except main (article); omicron
}  
----------------------------< M E S S A G E S >--------------------------------------------------------------  
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'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1&nbsp;ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et&nbsp;al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['mismatch'] = '<code>&#124;$1=</code> / <code>&#124;$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = 'Newsgroup:&nbsp;$1',
['notitle'] = 'No title', -- for |title=() and (in the future) |title=
['original'] = 'the original',
['origdate'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§&nbsp;$1',
['sections'] = '§§&nbsp;$1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',  
['vol'] = '$1 Vol.&nbsp;$2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol.&nbsp;$2, no.&nbsp;$3', -- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
['issue'] = '$1 No.&nbsp;$2', -- $1 is sepc  
['art'] = '$1 Art.&nbsp;$2', -- $1 is sepc; for only
['vol-art'] = '$1 Vol.&nbsp;$2, art.&nbsp;$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.&nbsp;$2", -- $1 is sepc
['pp-prefix'] = "$1 pp.&nbsp;$2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages  
['sheet'] = '$1 Sheet&nbsp;$2', -- $1 is sepc
['sheets'] = '$1 Sheets&nbsp;$2', -- $1 is sepc
['j-sheet'] = ': Sheet&nbsp;$1',
['j-sheets'] = ': Sheets&nbsp;$1',  
['language'] = '(in $1)',
['via'] = " &ndash; via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',  
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',  
-- categories
['cat wikilink'] = '', -- $1 is the category name
['cat wikilink sk'] = '', -- $1 is the category name; $2 is namespace sort key
[':cat wikilink'] = 'link', -- 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'] = '<span>One or more <code>&#123;{$1}}</code> templates have errors</span>; messages may be hidden ().'; -- $1 is template link
['warning_msg_m'] = '<span>One or more <code>&#123;{$1}}</code> templates have maintenance messages</span>; messages may be hidden ().'; -- $1 is template link
}  
--CitationClass= in the cs1|2 templates to the canonical template name when
the value assigned to |CitationClass= is different from the canonical template name. |CitationClass= values are
used as class attributes in the <cite> tag that encloses the citation so these names may not contain spaces while
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the
template's documentation when an article is displayed in preview mode.  
Most cs1|2 template |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',
}  
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------  
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 = {