Module:Citation/CS1/Configuration

From Roovet Articles
Jump to navigation Jump to search

{{#lst:Module:Citation/CS1/doc|header}} This configuration file contains various data that controls the functioning of Module:Citation/CS1 and hence the way that Lua-based citations are generated.

It has several sections among which are:

  1. translation tables that contain most of the literal strings that may be included in Lua-based citation. If editors are copying this Module to another wiki using a language other than English, then they should translate each of these values into that language.
  2. a list of error conditions specifying what text to display, what category to include (if any), and what help page section to refer to when errors are detected
  3. a list of ID handlers specifying the recognized document IDs, such as ISBN, DOI, etc., and how to format them.

{{#lst:Module:Citation/CS1/doc|module_components_table}}


-- Module:Citation/CS1/Configuration (PURE DATA ONLY — safe for mw.loadData)

local cfg = {}

-- simple flags
cfg.use_identifier_redirects = true
cfg.local_lang_cat_enable = false

-- text messages used by CS1
cfg.messages = {
	['retrieved'] = 'Retrieved $1',
	['archived'] = 'Archived',
	['via'] = ' — via $1',
	['language'] = '(in $1)',
	['notitle'] = 'No title',
	['vol'] = 'Vol. $1',
	['issue'] = 'No. $1',
	['p-prefix'] = 'p. $1',
	['pp-prefix'] = 'pp. $1',
	['j-page(s)'] = ': $1',
}

-- common parameter aliases
cfg.aliases = {
	url            = {'url','URL','link'},
	title          = {'title'},
	work           = {'work','website','journal','newspaper','magazine'},
	publisher      = {'publisher'},
	date           = {'date','publication-date','year','year_published'},
	['access-date']= {'access-date','accessdate'},
	language       = {'language','lang'},
	location       = {'location','place'},
	via            = {'via'},
	format         = {'format'},
	quote          = {'quote','quotation'},
	['archive-url']= {'archive-url','archiveurl'},
	['archive-date']= {'archive-date','archivedate'},
	author         = {'author','last','first','last1','first1','author1'},
	authors        = {'authors','author2','author3'},
	page           = {'page','p'},
	pages          = {'pages','pp'},
	issue          = {'issue','number'},
	volume         = {'volume','vol'},
	doi            = {'doi'},
	isbn           = {'isbn'},
	issn           = {'issn'},
}

-- placeholders CS1 expects to exist (must be tables, but can be empty)
cfg.id_handlers          = {}   -- real handlers come from require('Module:Citation/CS1/Identifiers')
cfg.whitelist            = { parameters = {}, deprecated = {}, aliases = {}, keywords = {} }
cfg.citation_issue_t     = {}
cfg.citation_no_volume_t = {}
cfg.presentation         = {}
cfg.keywords_lists       = {}
cfg.error_conditions     = {}

return cfg