Module:Citation/CS1/Suggestions/sandbox: Difference between revisions

Content deleted Content added
No edit summary
Remove |translator= from suggestion list as it is meanwhile a supported parameter. Suggest superset parameter |date= instead of the discouraged parameter |year=. Refine several foreign language suggestions to reflect changes in parameters supported by English citation templates. Add various suggestions to emulate parameters supported by German citation templates as much as possible.
Line 1:
--[[
 
History of changes since last sync: 2017-04-29
2018-07-31: remove lang from suggestion list as it is now explicitly whitelisted; see Help_talk:Citation_Style_1#lang_on_suggestion_list_removed;_general_q_about_suggestion_list
2020-02-16: sync from live; add |deadurl= and |dead-url=; |doi_brokendate=, |doi_inactivedate=, |template doc demo=, |trans_chapter=, |trans_title= added earlier but apparently not documented; see Wikipedia:Village_pump_(technical)#Automated_suggestion_for_%7Cdead-url%3D_%7Cdeadurl%3D_to_%7Curl-status
 
* 2018-07-31: remove lang from suggestion list as it is now explicitly whitelisted; see Help_talk:Citation_Style_1#lang_on_suggestion_list_removed;_general_q_about_suggestion_list
* 2020-02-16: sync from live; add |deadurl= and |dead-url=; |doi_brokendate=, |doi_inactivedate=, |template doc demo=, |trans_chapter=, |trans_title= added earlier but apparently not documented; see Wikipedia:Village_pump_(technical)#Automated_suggestion_for_%7Cdead-url%3D_%7Cdeadurl%3D_to_%7Curl-status
* 2020-06-16: Remove |translator= from suggestion list as it is now a supported parameter. Suggest superset parameter |date= instead of the discouraged parameter |year=. Refine several foreign language suggestions to reflect changes in parameters supported by English citation templates. Add various suggestions to emulate parameters supported by German citation templates as much as possible.
]]
 
-- Please insert new suggestions in alphabetical order
-- The form is ['incorrect'] = 'correct',
 
suggestions = {
['accessmonthabruf'] = 'access-date', -- German
['abruf-verborgen'] = 'access-date', -- German
['accessmonth'] = 'access-date', -- no longer supported by us, but still by citation templates mirrored in foreign WPs; can be emulated using 'access-date'
['accesso'] = 'access-date', -- Italian
['accessyear'] = 'access-date', -- no longer supported by us, but still by citation templates mirrored in foreign WPs; can be emulated using 'access-date'
['address'] = '___location',
['année'] = 'yeardate', -- French
['año'] = 'yeardate',
['año-original'] = 'orig-year',
['añoacceso'] = 'access-date', -- Spanish
['annoaccesso'] = 'access-date', -- Italian
['annodiaccesso'] = 'access-date', -- Italian
['apellido'] = 'last', -- Spanish
['archiv-datum'] = 'archive-date', -- German
['archive date'] = 'archive-date',
['archiv-url'] = 'archive-url', -- German
['archive url'] = 'archive-url', -- Spanish
['artikelnr'] = 'id', -- German (as 'id=Article No. ...') (not yet supported by us directly)
['artist'] = 'others',
['auflage'] = 'edition', -- German
['auteur'] = 'author', -- French
['auther'] = 'author',
['author link'] = 'author-link', -- Polish
['author link2'] = 'author2-link', -- Polish
['autor'] = 'authors', -- German (singular and plural)
['autore'] = 'author', -- Italian
['autthor'] = 'author',
['band'] = 'volume', -- German
['bandreihe'] = 'volume', -- German
['ch'] = 'language', -- German (as 'language=de-CH')
['chapter_title'] = 'chapter',
['cita'] = 'quote', -- Spanish
['citazione'] = 'quote', -- Italian
['coauthor'] = 'author',
['coauthors'] = 'author',
['coautores'] = 'author', -- Spanish
['coautori'] = 'author', -- Italian
['cognome'] = 'last', -- Italian
['consulté lecomment'] = 'access-datepostscript', -- French
['czasopismoconsulté le'] = 'journalaccess-date', -- PolishFrench
['dataczasopismo'] = 'datejournal', -- Polish, Italian
['dataarchiviodata'] = 'archive-date', -- Polish, Italian
['data dostępudataarchivio'] = 'accessarchive-date', -- PolishItalian
['datumdata dostępu'] = 'access-date', -- GermanPolish
['datum'] = 'date', -- German
['deadlink'] = 'url-status',
['deadurl'] = 'url-status',
['dead-url'] = 'url-status',
['distributor'] = 'publisher',
['dnb'] = 'id', -- German (as 'id={{DNB-IDN|...}}') (not yet supported by us directly)
['doi_brokendate'] = 'doi-broken-date',
['doi_inactivedate'] = 'doi-inactive-date',
['éditeur'] = 'editor', -- French
['editon'] = 'edition',
['editoin'] = 'edition',
['editora'] = 'publisher', -- Portuguese
['editorial'] = 'publisher',
['en ligne le'] = 'archive-date', -- French
['encyclopædia'] = 'encyclopedia',
['enlaceautor'] = 'author-link', -- Spanish
['fecha'] = 'date', -- Spanish
['fechaacceso'] = 'access-date', -- Spanish
['fechaarchivo'] = 'archive-date', -- Spanish
['filetype'] = 'format',
['first 1'] = 'first1',
['foramt'] = 'format',
['formato'] = 'format', -- Spanish, Italian, Polish
['frist'] = 'first',
['herausgeberfundstelle'] = 'editorsat', -- German (singularnot directly supported andby pluralus)
['idiomaherausgeber'] = 'languageeditors', -- Spanish,German (singular and Italianplural)
['imięhrsg'] = 'firstpublisher', -- PolishGerman
['isbnistformalfalschhrsgreihe'] = 'ignore-isbn-erroreditor', -- German
['idioma'] = 'language', -- Spanish, Italian
['opublikowanyimię'] = 'agencyfirst', -- Polish
['isbndefekt'] = 'ignore-isbn-error', -- German
['isbnformalfalsch'] = 'ignore-isbn-error', -- German
['isbnistformalfalsch'] = 'ignore-isbn-error', -- German
['isnb'] = 'isbn',
['jahrissnformalfalsch'] = 'yearignore-issn-error', -- German
['kapiteljahr'] = 'chapterdate', -- German
-- ['kommentarjahrea'] = 'commentorig-year', -- German (not yeta direct replacement, but supportedcan bybe usemulated)
['kapitel'] = 'chapter', -- German
['kbytes'] = 'format', -- German (not a direct replacement, but can be emulated)
['kommentar'] = 'postscript', -- German (not a direct replacement, but can be emulated)
['langauge'] = 'language',
['langue'] = 'language', -- French
['last 1'] = 'last1',
['lieu'] = '___location', -- French
['lingua'] = 'language', -- Italian
['lire en ligne'] = 'url', -- French
['lizenznummer'] = 'id', -- German (as 'id=License ...')
['loaction'] = '___location',
['locatoin'] = '___location',
['lugar'] = '___location', -- Spanish
['miejsce'] = '___location', -- Polish
['miesiąc'] = 'date', -- Polish
['mois'] = 'date', -- French
['monat'] = 'date', -- German
-- ['name'] = 'author', -- 'name' is often erroneously used for 'title' and 'work' as well, so no suggestion is better than a wrong suggestion
['nazwisko'] = 'last', -- Polish
['nespaper'] = 'newspaper',
['newpaper'] = 'newspaper',
['news'] = 'newspaper',
['nom'] = 'last', -- French
['nom1'] = 'last1', -- French
['nombre'] = 'first', -- Spanish
['nome'] = 'first', -- Italian
['nummer'] = 'number', -- German
['obranummerreihe'] = 'worknumber', -- SpanishGerman
['odpowiedzialnośćobra'] = 'agencywork', -- PolishSpanish
['offlineodpowiedzialność'] = 'url-statusagency', -- GermanPolish
['onlineoffline'] = 'url-status', -- German (notas a direct replacement, but can be emulated'url-status=dead')
['online'] = 'url', -- German (not a direct replacement, but can be emulated)
['opublikowany'] = 'agency', -- Polish
['operaopublikowany'] = 'workagency', -- ItalianPolish
['sérieopera'] = 'work', -- French *RECHECK*Italian
['origdate'] = 'orig-year',
['originaljahr'] = 'orig-year', -- German
['originalort'] = '___locationpublication-place', -- German (if 'ort' is specified at the same time, the latter should be put in 'publication-place')
['originalsprache'] = 'language', -- German
['originaltitel'] = 'title', -- German (if 'originaltitel' is specified, any possible contents of 'title' should be put in 'trans-title')
['ort'] = '___locationpublication-place', -- German
['ortea'] = 'publishing-place', -- German (not a direct replacement, but can be emulated)
['other'] = 'others',
['oznaczenie'] = 'agency', -- Polish
['pagees'] = 'pages',
['página'] = 'page', -- Spanish, Italian
['páginas'] = 'pages', -- Spanish, Italian
['passage'] = 'pages', -- French
['pagina'] = 'pages', -- Italian
['pagine'] = 'pages', -- Italian
['périodique'] = 'publisher', -- French
['plublisher'] = 'publisher',
['pmcid'] = 'pmc',
['praca'] = 'work', -- Polish
['prénom'] = 'first', -- French
['prénom1'] = 'first1', -- French
['ps'] = 'postscript',
['pub'] = 'publisher',
['pulbication-place'] = 'publication-place',
['reihe'] = 'series', -- German
['retrieved'] = 'access-date',
['rok'] = 'date', -- Polish
['sammelwerk'] = 'work', -- German
['seitenseria'] = 'pagesseries', -- GermanPolish
['seriasérie'] = 'series', -- PolishFrench
['série'] = 'work', -- French *RECHECK*
['service'] = 'agency',
['sitioweb'] = 'website', -- Spanish
['sito'] = 'website', -- Italian
['stron'] = 'page', -- Polish
['strony'] = 'pages', -- Polish
['spalten'] = 'at', -- German (not a direct replacement, but can be emulated)
['sprache'] = 'language', -- German
['suscripción'] = 'subscriptionurl-access', -- Spanish, Polish (as |url-access=subscription)
['tag'] = 'date', -- German
['template doc demo'] = 'template-doc-demo',
['tile'] = 'title',
['tite'] = 'title',
['titel'] = 'title', -- German
['titel-p'] = 'title', -- German ('postscript=none' should be added as well)
['titelerg'] = 'contribution', -- German (not a direct replacement, but can be emulated)
['titolo'] = 'title', -- Spanish, Italian
['titre'] = 'title', -- French
['títle'] = 'title',
['título'] = 'title', -- Spanish
['transchapter'] = 'trans-chapter',
['trans_chapter'] = 'trans-chapter',
['trans_title'] = 'trans-title',
['translator'] = 'others',
['transtitle'] = 'trans-title',
['typ'] = 'author-mask', -- German (not a direct replacement, but the only valid argument 'typ=wl' can be emulated using 'author-mask')
['tytuł'] = 'title', -- Polish
['ubicación'] = '___location', -- Spanish
['urlarchivoumfang'] = 'archive-urlpostscript', -- SpanishGerman (not yet directly supported by us)
['urlarchiviourlarchivo'] = 'archive-url', -- ItalianSpanish
['urnurlarchivio'] = 'idarchive-url', -- Italian
['urn'] = 'id', -- German (as 'id={{URN|...}}') (not yet supported by us directly)
['übersetzer'] = 'translator', -- German (singular and plural)
['verlag'] = 'publisher', -- German
['verlagea'] = 'publisher', -- German (not a direct replacement, but can be emulated)
['vol'] = 'volume',
['volumen'] = 'volume', -- Spanish
['werk'] = 'work', -- German
['werkerg'] = 'contribution', -- German (not a direct replacement, but can be emulated)
['wkautore'] = 'author-link', -- Italian
['wolumin'] = 'volume', -- Polish
['wydanie'] = 'number', -- Polish
['wydawca'] = 'publisher', -- French
['zaprezentowany'] = 'publisher', -- French
['zdb'] = 'id', -- German (as 'id={{ZDB|...}}') (not yet supported by us directly)
['zitat'] = 'quote', -- German
['zugriff'] = 'access-date', -- German
}
 
Line 189 ⟶ 207:
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
 
Here we use Lua patterns to make suggestions. The form is

['pattern'] = 'correct',
 
Lua patterns are not regexREGEX though they are similar. The escape character is '%', not '\'. For more information about
luaFor more information about Lua patterns, see: Extension:Scribunto/Lua_reference_manual#Patterns
 
Patterns should probably always include the '^' and '$' anchor assertions to prevent a partial match from incorrectly
match from incorrectly suggesting the wrong parameter name. For instance, the pattern 'a[utho]+r'
matches 'author' in the no-longer-supported parameter |author-separator= so the code suggests
parameter |author-separator= so the code suggests '|author='; the same pattern also matches the no-longer-supported parameter |separator= (returning 'ator')
parameter |separator= (returning 'ator') so again, the code suggests '|author='.
 
One capture is supported, typically the enumerator from an enumerated parameter (the '6' in |author6=, etc.) The value from the
The value from the capture replaces $1 in the 'correct' value.
 
]]
Line 207 ⟶ 228:
['^ac+es+ ?d?a?t?e?$'] = 'access-date',
['^a[utho]+r$'] = 'author',
['^a[utho]+r(%d+)$'] = 'author$1', -- enumerated
['^pu[blish]+ers?$'] = 'publisher',
}