Jump to content

Module:Cite/config/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 3: Line 3:
settings definitions for i18n; translate only the rvalues
settings definitions for i18n; translate only the rvalues


this goes away if support for positional parameter goes away
]]
]]


Line 15: Line 14:
--[[--------------------------< E R R O R _ M E S S A G E S _ T >----------------------------------------------
--[[--------------------------< E R R O R _ M E S S A G E S _ T >----------------------------------------------


TODO: if all we have is on error message, make it part of <settings_t> and get rid of this table?
this goes away if support for positional parameter goes away
]]
]]


local error_messages_t = {
local error_messages_t = {
missing = 'missing template name as first positional parameter',
-- missing = 'missing template name as first positional parameter', -- TODO: delete
unknown = 'unknown template name: $1', -- $1 is value supplied as template name in first positional parameter
unknown = 'unknown template name: $1', -- $1 is value supplied as template name in first positional parameter
}
}




--[[--------------------------< K N O W N _ T E M P L A T E S _ L O W E R _ C A S E _ T >----------------------
--[[--------------------------< K N O W N _ T E M P L A T E S _ T >--------------------------------------------


list of all known cs1|2 templates by their lowercase names. Lowercase is the canonical form for all cs1|2
list of all known cs1|2 templates by their lowercase names.
templates except for those named in <known_templates_mixed_case_t>.


key is lowercase template name
key is lowercase template name
Line 70: Line 68:
Canonical template names for those templates that use mixed capitalization. They will be normalized before
Canonical template names for those templates that use mixed capitalization. They will be normalized before
being passed to 'Module:Citation/CS1'
being passed to 'Module:Citation/CS1'

TODO: delete


]]
]]


local known_templates_mixed_case_t = {
--local known_templates_mixed_case_t = {
['arXiv'] = true,
-- ['arXiv'] = true,
['AV media'] = true,
-- ['AV media'] = true,
['AV media notes'] = true,
-- ['AV media notes'] = true,
['bioRxiv'] = true,
-- ['bioRxiv'] = true,
['CiteSeerX'] = true,
-- ['CiteSeerX'] = true,
['medRxiv'] = true,
-- ['medRxiv'] = true,
['SSRN'] = true,
-- ['SSRN'] = true,
}
-- }




Line 108: Line 108:


return {
return {
error_messages_t = error_messages_t, -- this goes away if support for positional parameter goes away
error_messages_t = error_messages_t,
settings_t = settings_t, -- this goes away if support for positional parameter goes away
settings_t = settings_t,
citation_classes_t = citation_classes_t,
citation_classes_t = citation_classes_t,
known_templates_mixed_case_t = known_templates_mixed_case_t,
-- known_templates_mixed_case_t = known_templates_mixed_case_t, -- TODO: delete
known_templates_lower_case_t = known_templates_lower_case_t,
known_templates_lower_case_t = known_templates_t, -- TODO: delete
known_templates_t = known_templates_t,
}
}

Revision as of 19:31, 23 April 2025

--[[--------------------------< S E T T I N G S >--------------------------------------------------------------

settings definitions for i18n; translate only the rvalues

]]

local settings_t = {
	err_category = 'cite module',												-- name of category that lists article with Module:Cite errors
	help = 'help',																-- help link display text for error messages
	help_text_link = 'Help:CS1 errors#module_cite'								-- help text for error messages can be found on this page
	}


--[[--------------------------< E R R O R _ M E S S A G E S _ T >----------------------------------------------

TODO: if all we have is on error message, make it part of <settings_t> and get rid of this table?
]]

local error_messages_t = {
--	missing = 'missing template name as first positional parameter',			-- TODO: delete
	unknown = 'unknown template name: $1',										-- $1 is value supplied as template name in first positional parameter
	}


--[[--------------------------< K N O W N _ T E M P L A T E S _ T >--------------------------------------------

list of all known cs1|2 templates by their lowercase names.

key is lowercase template name

]]

local known_templates_lower_case_t = {
	['arxiv'] = true,
	['av media'] = true,
	['av media notes'] = true,
	['biorxiv'] = true,
	['book'] = true,
	['citation'] = true,
	['citeseerx'] = true,
	['conference'] = true,
	['document'] = true,
	['encyclopedia'] = true,
	['episode'] = true,
	['interview'] = true,
	['journal'] = true,
	['magazine'] = true,
	['mailing list'] = true,
	['map'] = true,
	['medrxiv'] = true,
	['news'] = true,
	['newsgroup'] = true,
	['podcast'] = true,
	['press release'] = true,
	['report'] = true,
	['serial'] = true,
	['sign'] = true,
	['speech'] = true,
	['ssrn'] = true,
	['tech report'] = true,
	['thesis'] = true,
	['web'] = true,
	}


--[[--------------------------< K N O W N _ T E M P L A T E S _ M I X E D _ C A S E _ T >----------------------

Canonical template names for those templates that use mixed capitalization.  They will be normalized before
being passed to 'Module:Citation/CS1'

TODO: delete

]]

--local known_templates_mixed_case_t = {
--	['arXiv'] = true,
--	['AV media'] = true,
--	['AV media notes'] = true,
--	['bioRxiv'] = true,
--	['CiteSeerX'] = true,
--	['medRxiv'] = true,
--	['SSRN'] = true,
--	}


--[[--------------------------< C I T A T I O N _ C L A S S E S _ T >-----------------------------------------

|CitationClass= in the cs1|2 templates gets the lowercase template name except for these for which the canonical
template name has multiple words (and the oddity that is class="encyclopaedia" – really ought to fix that in
Module:Citation/CS1)

key is lowercase canonical template name

]]

local citation_classes_t = {
	['av media'] = 'audio-visual',
	['av media notes'] = 'AV-media-notes',
	['encyclopedia'] = 'encyclopaedia',
	['mailing list'] = 'mailinglist',
	['press release'] = 'pressrelease',
	['tech report'] = 'techreport',
	}


--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]

return {
	error_messages_t = error_messages_t,
	settings_t = settings_t,
	citation_classes_t = citation_classes_t,
--	known_templates_mixed_case_t = known_templates_mixed_case_t,				-- TODO: delete
	known_templates_lower_case_t = known_templates_t,							-- TODO: delete
	known_templates_t = known_templates_t,
	}