Module:Citation/CS1/Configuration and Module:Citation/CS1/Configuration/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Trappist the monk
synch from sandbox;
 
imported>Trappist the monk
Undid revision 1327098729 by OwenBlacker (talk) IETF tags not supported for |script-whatever= parameters;
 
Line 1: Line 1:
--[[
History of changes since last sync: 2025-08-30
2025-09-02: Add 10.1093/pnasnexus to free DOI prefix recognition (PNAS Nexus)
2025-09-11: Add 10.53347 to free DOI recognition (Radiopedia)
2025-09-21: i18n fixes; see Help_talk:Citation_Style_1#i18n:_Translatable_texts_from_Module:Citation/CS1
2025-10-01: Add 10.1016/j.animal to free DOI recognition (Animal)
2025-10-01: 10.1109/oa and 10.1109/oj to free DOI recognition (IEEE Open Access..., IEEE Open Journal...)
2025-12-12: Add 'kaa' to script_lang_codes
]]
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates  
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates  


Line 69: Line 80:
['archived-dead'] = 'Archived from $1 on $2',
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-live'] = '$1 from the original on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived-unfit'] = 'Archived from the original on $1',
['archived'] = 'Archived',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
Line 79: Line 90:
['et al'] = 'et al.',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inactive'] = ' (inactive $1)', -- $1 is date which the doi was found to be broken in
['inset'] = '$1 inset',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['interview'] = 'Interviewed by $1',
invisible_1 = '$1 $2', -- $1 stripmarker name; $2 is text from <invisible_chars[1]>
invisible_2 = '$1 character', -- $1 character name from <invisible_chars[1]>
['mismatch'] = '<code class="cs1-code">&#124;$1=</code> / <code class="cs1-code">&#124;$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['mismatch'] = '<code class="cs1-code">&#124;$1=</code> / <code class="cs1-code">&#124;$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]:&nbsp;$1',
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]:&nbsp;$1',
Line 96: Line 109:
['translated'] = 'Translated by $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['type'] = ' ($1)', -- for titletype
wikidata = 'Wikidata', -- these used for interwikilinked author/editor/... names
wikipedia = 'Wikipedia',
wikisource = 'Wikisource',
['written'] = 'Written at $1',
['written'] = 'Written at $1',


Line 123: Line 141:
['via'] = " &ndash; via $1",
['via'] = " &ndash; via $1",
['event'] = 'Event occurs at',
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
['minutes'] = ' $1 minutes in', -- $1 is the number of minutes
-- Determines the location of the help page
-- Determines the location of the help page
Line 141: Line 159:
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
-- ['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
['warning_msg_m'] = '<span style="color:#085">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
-- ['warning_msg_m'] = '<span style="color:#085">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
 
['warning_msg_e'] = '<span style="color:#d33"><code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code>: this [[#$2|reference]] has errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link; $2 is anchor ID
['warning_msg_m'] = '<span style="color:#085"><code style="color: inherit; background: inherit; border: none; padding: inherit;">&#123;{$1}}</code>: this [[#$2|reference]] has maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link; $2 is anchor ID
}
}


Line 153: Line 174:
the canonical template name may.  These names are used in warning_msg_e and warning_msg_m to create links to the
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.
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
local citation_class_map_t = { -- TODO: in Module:Cite/config write a function to use this table
['arxiv'] = 'arXiv',
arxiv = 'cite arXiv', -- as the source for known_templates_t and citation_classes_t
['audio-visual'] = 'AV media',
['audio-visual'] = 'cite AV media',
['AV-media-notes'] = 'AV media notes',
['AV-media-notes'] = 'cite AV media notes',
['biorxiv'] = 'bioRxiv',
biorxiv = 'cite bioRxiv',
['citeseerx'] = 'CiteSeerX',
book = 'cite book',
['encyclopaedia'] = 'encyclopedia',
citation = 'citation',
['mailinglist'] = 'mailing list',
citeseerx = 'cite CiteSeerX',
['medrxiv'] = 'medRxiv',
conference = 'cite conference',
['pressrelease'] = 'press release',
document = 'cite document',
['ssrn'] = 'SSRN',
encyclopaedia = 'cite encyclopedia',
['techreport'] = 'tech report',
episode = 'cite episode',
interview = 'cite interview',
journal = 'cite journal',
magazine = 'cite magazine',
mailinglist = 'cite mailing list',
map = 'cite map',
medrxiv = 'cite medRxiv',
news = 'cite news',
newsgroup = 'cite newsgroup',
podcast = 'cite podcast',
pressrelease = 'cite press release',
report = 'cite report',
serial = 'cite serial',
sign = 'cite sign',
speech = 'cite speech',
ssrn = 'cite SSRN',
techreport = 'cite tech report',
thesis = 'cite thesis',
web = 'cite web',
}
}


Line 511: Line 548:
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191';
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191';
local special_case_translation = {
local special_case_translation = {
author = 'author',
editor = 'editor',
name_list_params = '$1-name-list parameters', -- $1 is 'author' or 'editor'; used with err_redundant_parameters
['AuthorList'] = 'authors list', -- used to assemble maintenance category names
['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
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
Line 1,195: Line 1,236:
local script_lang_codes = {
local script_lang_codes = {
'ab', 'am', 'ar', 'az', 'be', 'bg', 'bn', 'bo', 'bs', 'ce', 'chr', 'cu',
'ab', 'am', 'ar', 'az', 'be', 'bg', 'bn', 'bo', 'bs', 'ce', 'chr', 'cu',
'dv', 'dz', 'el', 'fa', 'grc', 'gu', 'he', 'hi', 'hy', 'ja', 'ka', 'kk',
'dv', 'dz', 'el', 'fa', 'grc', 'gu', 'he', 'hi', 'hy', 'ja', 'ka', 'kaa',
'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk', 'ml', 'mn', 'mni', 'mr', 'my',
'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk', 'ml', 'mn', 'mni', 'mr',
'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr', 'syc', 'ta', 'te',
'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr', 'syc', 'ta',
'tg', 'th', 'ti', 'tkr', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue', 'zh',
'te', 'tg', 'th', 'ti', 'tkr', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue',
'zgh'
'zh', 'zgh'
};
};


Line 1,329: Line 1,370:
'17645', '18637', '19080', '19173', '20944', '21037', '21468', '21767', '22261', '22323', '22459', '24105', '24196', '24966',
'17645', '18637', '19080', '19173', '20944', '21037', '21468', '21767', '22261', '22323', '22459', '24105', '24196', '24966',
'26775', '30845', '32545', '35711', '35712', '35713', '35995', '36648', '37126', '37532', '37871', '47128',
'26775', '30845', '32545', '35711', '35712', '35713', '35995', '36648', '37126', '37532', '37871', '47128',
'47622', '47959', '52437', '52975', '53288', '54081', '54947', '55667', '55914', '57009', '58647', '59081',
'47622', '47959', '52437', '52975', '53288', '53347', '54081', '54947', '55667', '55914', '57009', '58647', '59081',
}) do
}) do
registrants_t[v] = true; -- build a k/v table of known free-to-read doi registrants
registrants_t[v] = true; -- build a k/v table of known free-to-read doi registrants
Line 1,339: Line 1,380:
local extended_registrants_t = { -- known free registrants identifiable by the doi suffix incipit
local extended_registrants_t = { -- known free registrants identifiable by the doi suffix incipit
['1002'] = {'aelm', 'leap'}, -- Advanced Electronic Materials, Learned Publishing
['1002'] = {'aelm', 'leap'}, -- Advanced Electronic Materials, Learned Publishing
['1016'] = {'j.heliyon', 'j.nlp', 'j.patter', 'j.proche'}, -- Heliyon, Natural Language Processing, Patterns, Procedia Chemistry
['1016'] = {'j.animal', 'j.heliyon', 'j.nlp', 'j.patter', 'j.proche'}, -- Animal, Heliyon, Natural Language Processing, Patterns, Procedia Chemistry
['1017'] = {'nlp'}, -- Natural Language Processing Journal
['1017'] = {'nlp'}, -- Natural Language Processing Journal
['1046'] = {'j.1365-8711', 'j.1365-246x'}, -- MNRAS, GJI
['1046'] = {'j.1365-8711', 'j.1365-246x'}, -- MNRAS, GJI
['1093'] = {'mnras', 'mnrasl', 'gji', 'rasti'}, -- MNRAS, MNRAS Letters, GJI, RASTI
['1093'] = {'mnras', 'mnrasl', 'gji', 'pnasnexus', 'rasti'}, -- MNRAS, MNRAS Letters, GJI, PNAS Nexus, RASTI
['1099'] = {'acmi', 'mic', '00221287', 'mgen'},                            -- Access Microbiology, Microbiology, Journal of General Microbiology, Microbial Genomics
['1099'] = {'acmi', 'mic', '00221287', 'mgen'},                            -- Access Microbiology, Microbiology, Journal of General Microbiology, Microbial Genomics
['1109'] = {'oa', 'oj'},                                                    -- IEEE Open Access..., IEEE Open Journal...
['1111'] = {'j.1365-2966', 'j.1745-3933', 'j.1365-246X'}, -- MNRAS, MNRAS Letters, GJI
['1111'] = {'j.1365-2966', 'j.1745-3933', 'j.1365-246X'}, -- MNRAS, MNRAS Letters, GJI
['1210'] = {'jendso','jcemcr'}, -- Journal of the Endocrine Society, JCEM Case Reports
['1210'] = {'jendso','jcemcr'}, -- Journal of the Endocrine Society, JCEM Case Reports
Line 1,371: Line 1,413:
['char'] = 'invalid character', -- |isbn=, |sbn=
['char'] = 'invalid character', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
empty_str = '(empty string)', -- empty unknown parameter check when cite has |=
['flag'] = 'flag', -- |archive-url=
['flag'] = 'flag', -- |archive-url=
['form'] = 'invalid form', -- |isbn=, |sbn=
['form'] = 'invalid form', -- |isbn=, |sbn=