Module:Citation/CS1/Configuration: Difference between revisions
sync to sandbox, mostly translation handles almost uniformity for archiveurl errors.
| m>Dragons flight  (enable visibility for parameter errors, isbn error, and wikilink in url error) | m>Dragons flight   (sync to sandbox, mostly translation handles almost uniformity for archiveurl errors.) | ||
| Line 1: | Line 1: | ||
| citation_config = {}; | |||
| --[[ | --[[ | ||
| Line 9: | Line 9: | ||
| ]] | ]] | ||
| citation_config.message_list = { | |||
|    ['published'] = 'published', |    ['published'] = 'published $1', | ||
|    ['lay summary'] = 'Lay summary', |    ['lay summary'] = 'Lay summary', | ||
|    ['retrieved'] = 'Retrieved', |    ['retrieved'] = 'Retrieved $1', | ||
|    ['inactive'] = 'inactive', |    ['inactive'] = 'inactive', | ||
|   ['archived-dead'] = 'Archived from $1 on $2', | |||
|   ['archived-not-dead'] = '$1 from the original on $2', | |||
|   ['archived-missing'] = 'Archived from the original$1 on $2', | |||
|    ['archived'] = 'Archived', |    ['archived'] = 'Archived', | ||
|    ['original'] = 'the original', |    ['original'] = 'the original', | ||
|    ['editor'] = 'ed.', |    ['editor'] = 'ed.', | ||
|    ['editors'] = 'eds.',   |    ['editors'] = 'eds.',   | ||
|    ['edition'] = 'ed.',   |    ['edition'] = '($1 ed.)',   | ||
|    ['episode'] = 'episode', |    ['episode'] = 'episode', | ||
|    ['season'] = 'season',   |    ['season'] = 'season',   | ||
|    ['series'] = 'series', |    ['series'] = 'series', | ||
|    ['written'] = 'Written at', |    ['written'] = 'Written at $1', | ||
|    ['et al'] = 'et al.',   |    ['et al'] = 'et al.',   | ||
|    ['subscription'] = '<span style="font-size:0.95em; font-size:90%; color:#555">(subscription required)</span>',   |    ['subscription'] = '<span style="font-size:0.95em; font-size:90%; color:#555">(subscription required)</span>',   | ||
|    [' |    ['language'] = '(in $1)',   | ||
|    ['via'] =  |    ['via'] = " — via $1", | ||
|    ['event'] = 'Event occurs at', |    ['event'] = 'Event occurs at', | ||
|    ['minutes'] = 'minutes in',   |    ['minutes'] = 'minutes in',   | ||
|   ['trans-title'] = "[$1]", | |||
|   ['quoted-title'] = '"$1"', | |||
|   ['italic-title'] = "''$1''", | |||
|   ['quoted-text'] = '"$1"', | |||
|   -- Error output | |||
|   ['hidden-error'] = '<span style="display:none;font-size:100%" class="error citation-comment">$1</span>', | |||
|   ['visible-error'] = '<span style="font-size:100%" class="error citation-comment">$1</span>', | |||
|    -- Determines the location of the help page |    -- Determines the location of the help page | ||
| Line 39: | Line 49: | ||
|    ['undefined_error'] = 'Called with an undefined error condition', |    ['undefined_error'] = 'Called with an undefined error condition', | ||
|    ['unknown_manual_ID'] = 'Unrecognized manual ID mode', |    ['unknown_manual_ID'] = 'Unrecognized manual ID mode', | ||
|    ['unknown_ID_mode'] = 'Unrecognized ID mode'    |    ['unknown_ID_mode'] = 'Unrecognized ID mode', | ||
|   ['unknown_argument_map'] = 'Argument map not defined for this variable' | |||
| } | |||
| --[[ | |||
| Argument map table | |||
| ]] | |||
| citation_config.argument_map = { | |||
|     ['AccessDate'] = 'accessdate', | |||
|     ['Agency'] = 'agency', | |||
|     ['AirDate'] = 'airdate', | |||
|     ['ArchiveDate'] = {'archive-date', 'archivedate' }, | |||
|     ['ArchiveURL'] = {'archive-url', 'archiveurl' }, | |||
|     ['ASINTLD'] = {'ASIN-TLD', 'asin-tld'}, | |||
|     ['At'] = 'at', | |||
|     ['Authors'] = 'authors', | |||
|     ['AuthorFormat'] = {"author-format", "authorformat" }, | |||
|     ['AuthorSeparator'] = 'author-separator', | |||
|     ['AuthorNameSeparator'] = 'author-name-separator', | |||
|     ['BookTitle'] = 'booktitle', | |||
|     ['Chapter'] = {'chapter', 'contribution', 'entry', 'article' }, | |||
|     ['ChapterLink'] = 'chapterlink', | |||
|     ['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl' }, | |||
|     ['Coauthors'] = {'coauthors', 'coauthor' }, | |||
|     ['Conference'] = 'conference', | |||
|     ['ConferenceURL'] = {'conference-url', 'conferenceurl' }, | |||
|     ['Date'] = 'date', | |||
|     ['Day'] = 'day', | |||
|     ['DeadURL'] = 'deadurl', | |||
|     ['DisplayAuthors'] = {"display-authors", "displayauthors"}, | |||
|     ['DisplayEditors'] = {"display-editors", "displayeditors"}, | |||
|     ['DoiBroken'] = {'doi_inactivedate', 'doi_brokendate', 'DoiBroken'}, | |||
|     ['Edition'] = 'edition', | |||
|     ['Editors'] = 'editors', | |||
|     ['EditorFormat'] = {"editor-format", "editorformat" }, | |||
|     ['EditorSeparator'] = 'editor-separator', | |||
|     ['EditorNameSeparator'] = 'editor-name-separator', | |||
|     ['Embargo'] = {'Embargo', 'embargo'}, | |||
|     ['Format'] = 'format', | |||
|     ['ID'] = {'id', 'ID', 'docket'}, | |||
|     ['IgnoreISBN'] = {'ignore-isbn-error', 'ignoreisbnerror'}, | |||
|     ['Issue'] = {'issue', 'number'}, | |||
|     ['Language'] = {'language', 'in'}, | |||
|     ['LastAuthorAmp'] = 'lastauthoramp', | |||
|     ['LayDate'] = 'laydate', | |||
|     ['LaySource'] = 'laysource', | |||
|     ['LaySummary'] = 'laysummary', | |||
|     ['Minutes'] = 'minutes', | |||
|     ['Month'] = 'month', | |||
|     ['NameSeparator'] = 'name-separator', | |||
|     ['Network'] = 'network', | |||
|     ['NoPP'] = 'nopp', | |||
|     ['NoTracking'] = {"template doc demo", 'nocat',  | |||
|         'notracking', "no-tracking"}, | |||
|     ['OrigYear'] = 'origyear', | |||
|     ['Others'] = 'others', | |||
|     ['Page'] = {'p', 'page'}, | |||
|     ['Pages'] = {'pp', 'pages'}, | |||
|     ['Periodical'] = {'journal', 'newspaper', 'magazine', 'work', | |||
|         'website',  'periodical', 'encyclopedia', 'encyclopaedia', 'dictionary'}, | |||
|     ['Place'] = {'place', 'location'}, | |||
|     ['PPrefix'] = 'PPrefix', | |||
|     ['PPPrefix'] = 'PPPrefix', | |||
|     ['PostScript'] = 'postscript', | |||
|     ['PublicationDate'] = {'publicationdate', 'publication-date' }, | |||
|     ['PublicationPlace'] = {'publication-place', 'publicationplace' }, | |||
|     ['PublisherName'] = 'publisher', | |||
|     ['Quote'] = {'quote', 'quotation'}, | |||
|     ['Ref'] = {'ref', 'Ref'}, | |||
|     ['Season'] = 'season', | |||
|     ['Separator'] = 'separator', | |||
|     ['Series'] = {'series', 'version'}, | |||
|     ['SeriesSeparator'] = 'series-separator', | |||
|     ['SeriesLink'] = 'serieslink', | |||
|     ['SeriesNumber'] = {'seriesnumber', 'seriesno'}, | |||
|     ['Station'] = 'station', | |||
|     ['SubscriptionRequired'] = 'subscription', | |||
|     ['Time'] = 'time', | |||
|     ['TimeCaption'] = 'timecaption', | |||
|     ['Title'] = 'title', | |||
|     ['TitleLink'] = {'titlelink', 'episodelink' }, | |||
|     ['TitleNote'] = 'department', | |||
|     ['TitleType'] = 'type', | |||
|     ['TransChapter'] = {'trans-chapter', 'trans_chapter' }, | |||
|     ['Transcript'] = 'transcript', | |||
|     ['TranscriptURL'] = {'transcript-url', 'transcripturl'}, | |||
|     ['TransTitle'] = {'trans-title', 'trans_title' }, | |||
|     ['URL'] = {'url', 'URL'}, | |||
|     ['Via'] = 'via', | |||
|     ['Volume'] = 'volume', | |||
|     ['Year'] = 'year', | |||
|     ['AuthorList-First'] = {"author#-first", "author-first#", | |||
|         "first#", "given#"}, | |||
|     ['AuthorList-Last'] = {"author#-last", "author-last#",  | |||
|         "last#", "surname#", "Author#", "author#", "authors#"}, | |||
|     ['AuthorList-Link'] = {"author#-link", "author-link#",  | |||
|         "author#link", "authorlink#"}, | |||
|     ['AuthorList-Mask'] = {"author#-mask", "author-mask#",  | |||
|         "author#mask", "authormask#"}, | |||
|     ['EditorList-First'] = {"editor#-first",  | |||
|         "editor-first#", "EditorGiven#"}, | |||
|     ['EditorList-Last'] = {"editor#-last", "editor-last#", | |||
|         "EditorSurname#", "Editor#", "editor#", "editors#"}, | |||
|     ['EditorList-Link'] = {"editor#-link", "editor-link#",  | |||
|         "editor#link", "editorlink#"}, | |||
|     ['EditorList-Mask'] = {"editor#-mask", "editor-mask#",  | |||
|         "editor#mask", "editormask#"}, | |||
| } | |||
| --[[ | |||
| Default parameter values | |||
| ]] | |||
| citation_config.default_values = { | |||
|     ['DeadURL'] = 'yes', | |||
|     ['PostScript'] = '.', | |||
|     ['Separator'] = '.', | |||
|     ['AuthorSeparator'] = ';', | |||
|     ['EditorSeparator'] = ';', | |||
|     ['NameSeparator'] = ',', | |||
|     ['PPrefix'] = "p. ", | |||
|     ['PPPrefix'] = "pp. ",     | |||
| } | } | ||
| Line 52: | Line 185: | ||
| ]] | ]] | ||
| citation_config.error_conditions = { | |||
|      accessdate_missing_url = { |      accessdate_missing_url = { | ||
|          message = '<code>|accessdate=</code> requires <code>|url=</code>', |          message = '<code>|accessdate=</code> requires <code>|url=</code>', | ||
| Line 66: | Line 199: | ||
|          message = '<code>|archiveurl=</code> requires <code>|url=</code>', |          message = '<code>|archiveurl=</code> requires <code>|url=</code>', | ||
|          anchor = 'archive_missing_url', |          anchor = 'archive_missing_url', | ||
|          category = 'Pages with archiveurl citation errors', |          category = 'Pages with archiveurl citation errors', | ||
|          hidden = false }, |          hidden = false }, | ||
| Line 180: | Line 303: | ||
| } | } | ||
| citation_config.id_handlers = { | |||
|      ['ASIN'] = { |      ['ASIN'] = { | ||
|          parameters = { 'asin', 'ASIN' },         |          parameters = { 'asin', 'ASIN' },         | ||
| Line 361: | Line 484: | ||
| } | } | ||
| return  | return citation_config; | ||