Modul:Citation/i18n

Aus Wikivoyage
Template-info.png Dokumentation für das Modul Citation/i18n[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Verwendung

Das Modul stellt die Parametertabelle und Zeichenketten für die Internationalisierung des Moduls Citation zur Verfügung.

Versionsbezeichnung auf Wikidata: 2021-09-02 Ok!

Verwendung in anderen Modulen

Dieses Modul ist notwendig für die Ausführung folgender Module. Bei Anpassungen sollte die Funktionstüchtigkeit der folgenden Module geprüft werden. Benutze dazu auch diese Tracking-Kategorie um Fehler zu finden, die sich dann auf Artikel auswirken:

Hinweise
-- Separating code from internationalization

-- documentation
local citationI18n = {
	suite  = 'Citation',
	sub    = 'i18n',
	serial = '2021-09-02'
}

return {
	-- administration
	moduleInterface = citationI18n,

	-- options
	skipPathCheck = false, -- for URL check, see Module:UrlCheck

	-- project information
	project = {
		name = 'wikivoyage.org',
		languageCode = mw.language.getContentLanguage():getCode(),
		language = mw.language.fetchLanguageName( mw.language.getContentLanguage():getCode() )
	},

	-- list of valid type values
	refTypes = {
		book       = { 'book', 'Buch' },
		map        = { 'map', 'Karte' },
		bookitem   = { 'bookitem', 'collection', 'Sammelwerk' },
		journal    = { 'journal', 'Zeitschrift' },
		newspaper  = { 'newspaper', 'Zeitung' },
		web        = { 'web', 'Web', 'Internet' },
		webnews    = { 'webnews', 'news', 'Nachricht' },
	},

	-- list of valid status values
	urlStatusTable = {
		dead    = { 'dead', 'offline' },
		live    = { 'live', 'online' },
		usurped = { 'unfit', 'usurped', 'usurpiert' }
	},

	-- list of possible parameter
	-- no index: possible parameter names
	-- types: reference types for which parameter is valid
	-- COinS: COinS key
	-- COinS_id: COinS id
	-- cleanup = true: complete cleanup
	params = {
		-- type, author and title
		type          = { 'type', 'Typ' },
		author        = { 'Autor', COinS = 'rft.au' },
		title         = { 'Titel', COinS = 'rft.title' },
		titleAddition = { 'TitelErg' },
		scale         = { 'Maßstab', types = 'map' },
		url           = { 'Online', 'URL' },
		access        = { 'Zugriff' },

		-- edited collections
		editor      = { 'Herausgeber', 'Hrsg' },
		collection  = { 'Sammelwerk', types = 'bookitem' },
		journal     = { 'Zeitschrift', 'Sammelwerk', types = 'journal', COinS = 'rft.jtitle' },
		newspaper   = { 'Zeitung', 'Sammelwerk', types = 'newspaper', COinS = 'rft.jtitle' },
		abbr        = { 'Abk', types = { 'bookitem', 'journal', 'newspaper' } },
		website     = { 'Website', 'Internet', 'Sammelwerk', types = { 'web', 'webnews' } },
		siteUrl     = { 'Site-URL', 'Website-URL', types = { 'bookitem', 'journal', 'newspaper', 'web', 'webnews' } },

		-- published
		place       = { 'Ort', COinS = 'rft.place' },
		publisher   = { 'Verlag', types = { 'book', 'map', 'bookitem', 'web', 'webnews' }, COinS = 'rft.pub' },
		date        = { 'Datum', 'Jahr', COinS = 'rft.date' },
		edition     = { 'Auflage', types = { 'book', 'map', 'bookitem' }, COinS = 'rft.edition' },
		series      = { 'Reihe', types = { 'book', 'bookitem', 'map' }, COinS = 'rft.series' },

		-- source
		volume      = { 'Band', types = { 'book', 'map', 'bookitem', 'journal', 'newspaper' }, COinS = 'rft.volume' },
		issue       = { 'Nummer', types = { 'journal', 'newspaper' }, COinS = 'rft.issue' },
		chapter     = { 'Kapitel', types = 'book', COinS = 'rft.atitle' },
		pages       = { 'Seiten', types = { 'book', 'bookitem', 'journal', 'newspaper', 'web', 'webnews' }, COinS = 'rft.pages' },
		columns     = { 'Spalten', types = { 'book', 'bookitem', 'journal', 'newspaper', 'web', 'webnews' } },

		-- key numbers
		isbn        = { 'ISBN', types = { 'book', 'bookitem', 'map', 'journal' }, COinS = 'rft.isbn' },
		issn        = { 'ISSN', COinS = 'rft.issn' },
		eissn       = { 'EISSN', COinS = 'rft.eissn' },
		ignoreError = { 'ignoreError' },

		doi         = { 'DOI', COinS_id = 'info:doi' },
		jstor       = { 'JSTOR', types = { 'journal', 'newspaper' } },
		dnb         = { 'DNB', types = { 'book', 'bookitem', 'map' } },
		oclc        = { 'OCLC', types = { 'book', 'bookitem', 'map' }, COinS_id = 'info:oclcnum' },

		-- archive
		urlStatus   = { 'URL-Status' },
		accessDate  = { 'Abruf' },
		archiveUrl  = { 'Archiv-URL' },
		archiveDate = { 'Archiv-Datum' },
		format      = { 'Format' },
		KBytes      = { 'KBytes' },
		MBytes      = { 'MBytes' },

		-- additional statesments
		extent      = { 'Umfang', 'Seitenanzahl', types = { 'book', 'bookitem', 'map' } },
		language    = { 'Sprache' },
		comment     = { 'Kommentar' },
		quote       = { 'Zitat' }
	},

	-- list of formatter strings
	-- formatting is geared to DIN 690 = ISO 690, and DIN 1505-2
	formatters = {
		-- author
		auAuthor = '<span class="cite-author">%s</span>',
		auAuthorAll = '%s: ',
		auAuthorEditor = '%s ; %s',
		auEditor = '<span class="cite-editor">%s</span>&nbsp;(Hrsg.)',

		-- title
		tiAll = '%s. ',
		tiAddition = '%s&nbsp;/ %s',
		tiChapter = 'Kapitel <span class="cite-chapter-title">%s</span>',
		tiCollectionTitle = '<span class="cite-collection-title">%s</span>',
		tiIn = 'In:&nbsp;',
		tiJournalTitle = '<span class="cite-journal-title">%s</span>',
		tiNewspaperTitle = '<span class="cite-newspaper-title">%s</span>',
		tiScale = 'Maßstab: <span class="cite-scale">%s</span>. ',
		tiSeries = '<span class="cite-series">%s</span>',
		tiTitle = '<span class="cite-title">%s</span>',
		tiVolume = '%s; Bd.&#x202F;<span class="cite-volume">%s</span>',
		tiWebsiteTitle = '<span class="cite-website-title">%s</span>',

		-- publisher
		puAll = '%s.',
		puDate = '<span class="cite-date">%s</span>',
		puDateEditionNum = '%s (%d.&#x202F;Auflage)',
		puDateEdition = '%s (%s)',
		puPlace = '<span class="cite-place">%s</span>',
		puPlaceDate = '%s, %s',
		puPlacePub = '%s: %s',
		puPublisher = '<span class="cite-publisher">%s</span>',

		-- additions
		addColumns = 'Sp.&#x202F;%s',
		addComment = ' %s',
		addDelimiter1 = ', ',
		addDelimiter2 = '; ',
		addExtent = '%s Seiten',
		addInLanguage = 'in %s',
		addLanguage = ' (%s)',
		addPages = 'S.&#x202F;%s',
		addQuote = ' <span class="cite-quotation">%s</span>',

		-- periodical	
		prAbbr = ' (%s)',
		prIssue = 'Nr.&#x202F;<span class="cite-issue">%s</span>',
		prPlace = ' &lt;<span class="cite-place">%s</span>&gt;',
		prVolume = 'Bd.&#x202F;<span class="cite-volume">%s</span>',
		prVolIssue = '%s,<span class="cite-issue">%s</span>',
		prVolYear = '%s (<span class="cite-date">%s</span>)',

		-- newspaper
		nsVolume = 'Jg.&#x202F;<span class="cite-volume">%s</span>',

		-- database ids
		dbDnb = '[[w:Deutsche Nationalbibliothek|DNB]] [https://d-nb.info/%s %s]',
		dbDoi = '[[w:Digital Object Identifier|doi]]:%s',
		dbOclc = '[[w:Online Computer Library Center|OCLC]] [https://worldcat.org/oclc/%s %s]',
		dbIssn = '[[w:Internationale Standardnummer für fortlaufende Sammelwerke|ISSN]] [https://zdb-katalog.de/list.xhtml?t=iss%3D%22xx1xx%22&key=cql xx1xx]',
		dbJstor = '[[w:JSTOR|JSTOR]] [https://www.jstor.org/stable/%s %s]',

		-- web
		wbAccess = 'abgerufen am %s',
		wbKBytes = 'Dateigröße: %s&#x202F;KByte',
		wbMBytes = 'Dateigröße: %s&#x202F;MByte',

		-- archive
		arArchived = 'Archiviert',
		arOriginal = 'Original',
		arArchive = ' %s vom %s.',
		arArchiveDate = ' %s vom %s am %s.',
		arOffline = ' %s nicht mehr verfügbar.'
	},

	accessTypes = {
		closed = { 'kostenpflichtig', 'Paywall', 'Paid Content', 'Bezahlung', 'closed', file = '[[File:Closed Access logo transparent.svg|9px|link=w:Paid Content|alt=Kostenpflichtiger Zugriff|Paid Content – kostenpflichtiger Zugriff]]' },
		free   = { 'frei', 'free', file = '[[File:Lock-green.svg|9px|link=w:Freie Inhalte|Freie Veröffentlichung – Neben dem Lesen weitere Nutzungsrechte]]' },
		mixed  = { 'gemischt', 'Freemium', 'mixed', file = '[[File:Mixed Access logo PLoS transparent.svg|9px|link=w:Freemium|alt=Unterschiedliche Nutzungsbedingungen|Unterschiedliche Nutzungsbedingungen – Nutzung teilweise gratis]]' },
		open   = { 'offen', 'open', file = '[[File:Open Access logo PLoS transparent.svg|9px|link=w:Open Access|alt=Open Access|Open-Access-Veröffentlichung – Nutzungsrecht zum Lesen]]' }
	},

	-- error categories and hints
	texts = {
		accessNoUrl   = '<span class="error">Zugriffsform ohne Internetlink</span>[[Category:Literatur: Zugriffsform ohne Internetlink]]',
		accesswrong   = '<span class="error">Unbekannte Zugriffsform</span>[[Category:Literatur: unbekannte Zugriffsform]]',
		decimalPoint  = ',',
		moreThan100   = '<span class="error">Dateigröße über 100 MB</span>[[Category:Literatur: Dateigröße über 100 MB]]',
		noTitle       = '<span class="error">Fehlender Titel</span>',
		noTitleUrl    = '<span class="error">Titel und URL fehlen</span>[[Category:Literatur: Titel und URL fehlen]]',
		noURL         = '<span class="error">Ungültige URL</span>[[Category:Literatur: ungültige URL]]',
		unknownParam  = '<span class="error">Ungültiger Parameter: %s</span>[[Category:Literatur: ungültige Parameter]]',
		unknownParams = '<span class="error">Ungültige Parameter: %s</span>[[Category:Literatur: ungültige Parameter]]',
		unknownTitle  = '[[Category:Literatur: fehlender Titel]]',
		unknownPeriodical = '[[Category:Literatur: fehlender Titel eines Periodikums]]',
		wrongChars    = '<span class="error">Ungültige Steuerzeichen</span>[[Category:Literatur: ungültige Steuerzeichen]]',
		wrongDate     = '<span class="error">Ungültiges Datum</span>[[Category:Literatur: ungültiges Datum]]',
		wrongIssn     = '<span class="error">Ungültige ISSN</span>[[Category:Seiten mit ISSN-Fehlern]]',
		wrongPages    = '<span class="error">Ungültige Seiten</span>[[Category:Literatur: ungültige Seiten]]',
		wrongType     = '<span class="error">Ungültiger Typ</span>[[Category:Literatur: ungültiger Typ]]',
		wrongValue    = '<span class="error">Ungültiger Wert: %s</span>[[Category:Literatur: ungültiger Wert]]',
		wrongValues   = '<span class="error">Ungültige Werte: %s</span>[[Category:Literatur: ungültiger Wert]]',
		KBytesMBytes  = '<span class="error">KBytes und MBytes gleichzeitig</span>[[Category:Literatur: KBytes und MBytes gleichzeitig]]'
	},

	citeClass      = 'citation ',

	addCiteClasses = {
		book      = 'printNoLink book',
		bookitem  = 'printNoLink book bookitem',
		journal   = 'printNoLink journal',
		map       = 'printNoLink book map',
		newspaper = 'printNoLink news newspaper',
		web       = 'web',
		webnews   = 'news'
	},

	replacements = {
		{ s = '([!%?…‥])%s*%.+', r = '%1' },
		{ s = "([!%?…‥]'')%s*%.+", r = '%1' },
		{ s = '([!%?…‥]</span>)%s*%.+', r = '%1' },
		{ s = '(%d+)%s+(f?f%.)', r = '%1&#x202F;%2' },
		{ s = '%s+([.:,;!?/›»])', r = '&#x202F;%1' },
		{ s = '([‹«])%s+', r = '%1&#x202F;' }
	}
}