Modulo:Marker utilities/i18n

El Vikivojaĝo
Salti al navigilo Salti al serĉilo

Versiokontrolo[redakti]

Versionomo en Vikidatumoj: 2021-11-28 Ok!


-- Separating code from internationalization

return {
	-- module administration
	moduleInterface  = {
		suite  = 'Marker utilities',
		sub    = 'i18n',
		serial = '2021-11-28',
		item   = 65441686
	},

	airportType      = 'airport',
	eventGroup       = 'do',
	dates            = { yyyymmdd = { p = '^20[0-5]%d%-[01]?%d%-[0-3]?%d$', f = 'j. M Y' },
	                     yyyy     = { p = '^20[0-5]%d$', f = 'Y' },
	                     yy       = { p = '^[0-5]%d$', f = 'Y' },
	                     mmdd     = { p = '^[01]?%d%-[0-3]?%d$', f = 'j. M' },
	                     dd       = { p = '^[0-3]?%d%.?$', f = 'j.' },
	                     mm       = { p = '^[01]?%d%.?$', f = 'M' },
	                     lastedit = { f = 'M Y' }
	                   },
	fileExtensions   = { 'tif', 'tiff', 'gif', 'png', 'jpg', 'jpeg', 'jpe',
	                     'webp', 'xcf', 'ogg', 'ogv', 'svg', 'pdf', 'stl',
	                     'djvu', 'webm', 'mpg', 'mpeg' },
	months           = { 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli',
	                     'August', 'September', 'Oktober', 'November', 'Dezember' },
	monthAbbr        = { 'Jan%.?', 'Feb%.?', 'Mär%.?', 'Apr%.?', 'Mai%.?', 'Jun%.?',
	                      'Jul%.?', 'Aug%.?', 'Sep%.?', 'Okt%.?', 'Nov%.?', 'Dez%.?' },

	-- Map related constants
	coordURL          = 'https://de.wikivoyage.org/w/index.php?title=Special%3AMapsources&params=',
	defaultDmsFormat  = 'f1', -- see: Module:Coordinates/i18n
	defaultSiteType   = 'type:landmark_globe:earth',
	defaultZoomLevel  = 17,
	maxZoomLevel      = 19,   -- also to set in Module:GeoData, Module:Mapshape utilities/i18n

	-- Wikidata related constants
	p31Limit          = 3, -- maximum count of P31 values to analyse
	searchLimit       = 4, -- count of levels for P31-P279 search

	-- Module names for parameter check maintenance messages
	moduleNames = {
		vcard  = 'VCard',
		marker = 'Marker'
	},

	-- Wikidata properties
	properties = {
		appliesToJurisdiction = 'P1001',
		appliesToPart     = 'P518',
		appliesToPeople   = 'P6001',
		capacity          = 'P1083',
		centerCoordinates = 'P5140',
		commonsCategory   = 'P373',
		coordinates       = 'P625',
		endTime           = 'P582',
		image             = 'P18',
		instanceOf        = 'P31',
		iso4217           = 'P498',
		languageOfName    = 'P407',
		mainCategory      = 'P910',
		maximumAge        = 'P4135',
		minimumAge        = 'P2899',
		nameInNativeLang  = 'P1559',
		occupation        = 'P106',
		of                = 'P642',
		officialName      = 'P1448',
		pointInTime       = 'P585',
		propertyScope     = 'P5314', -- for fees
		quantity          = 'P1114',
		retrieved         = 'P813',
		roomNumber        = 'P8733',
		startTime         = 'P580',
		streetAddress     = 'P6375',
		subclassOf        = 'P279',
		unitSymbol        = 'P5061',
		use               = 'P366',
		validInPeriod     = 'P1264'
	},

	-- Groups of Wikidata properties
	propTable = {
		quantity        = { 'P1114', 'P1083' },
		feeComments     = { 'P5314', 'P518', 'P6001', 'P1264', 'P585', 'P2899',
		                    'P4135', 'P642' },
		contactComments = { 'P366', 'P518', 'P642', 'P1001', 'P1559', 'P106' }
	},

	-- Wikidata properties representing a qualifier
	qualifiers = {
		intentionalSitelink = 'Q70894304',
		mobilePhone         = 'Q17517',
		redirectSitelink    = 'Q70893996',
		P8733               = 'Q180516',
		roomNumber          = 'Q180516'
	},

	-- Display and performance options for vCard / Listing module
	options = {
		defaultAuto     = false, -- vCard default auto mode
		defaultShow     = 'poi',
		lasteditHours   = true,
		lookForQuery    = false, -- check if URL query exists
		noTypeMsgs      = false, -- prevents display of maintenance( typeFromWD, typeIsGroup )
		showIata        = true,  -- possible values true, false
		showIcao        = true,
		showLocalData   = true,  -- names, addresses, directions
		showSisters     = true,  -- possible values true, false, 'atEnd'
		showUnesco      = true,
		useMobile       = true,  -- distinguish landline and mobile phones
		usePropertyCateg= true,  -- for Wikidata properties
		useTypeCateg    = true,  -- for marker types

		-- useful but not necessary function calls
		WDmediaCheck    = false, -- check file names retrieved from Wikidata
		mediaCheck      = false, -- for better performance, otherwise expensive
		                         -- mw.title.new( 'Media:' .. image ) call is used
		secondaryCoords = false, -- adding listing coordinates to article database
		                         -- using #coordinates parser function
		skipPathCheck   = false  -- for URL check, see Module:UrlCheck
	},

	-- Languages for fallbacks, except wiki language
	langs = {
		name    = 'en', -- one or no language ''
		address = { 'en', 'fr' } -- array can be empty
	},

	-- Formatting numbers: replacement patterns
	formatnum = {
		decimalPoint   = ',',
		groupSeparator = '.'
	},

	-- strings
	texts = {
		asOf           = 'Stand %s',
		from           = 'ab %s',
		fromTo         = '%s–%s',
		to             = 'bis %s',
		fromTo2        = '%s bis %s',

		-- Marker
		CategoryNS     = { '[Cc]ategory', '[Kk]ategorie' },
		FileNS         = { '[Ff]ile', '[Ii]mage', '[Dd]atei', '[Bb]ild' },
		latitude       = 'Breitengrad',
		longitude      = 'Längengrad',
		tooltip        = 'Nummer in der Karte
KLICK: direkt zur Karte',

		-- vCard / Listing module
		checkin        = 'Check-in: %s',
		checkout       = 'Check-out: %s',
		closed         = 'Geschlossen: %s',
		closedPattern  = '^[Gg]eschlossen:?%s*',
		email          = 'E-Mail: %s',
		expirationPeriod = 'now - 3 years',
		fax            = 'Fax: %s',
		hintName       = 'Name in der Landessprache %s',
		hintLatin      = 'Name in lateinischer Umschrift',
		hintAddress    = 'Anschrift in der Landessprache %s',
		hintAddress2   = 'Anschrift in %s',
		hintDirections = 'Lage in der Landessprache %s',
		hours          = 'Geöffnet: %s',
		iata           = '[[International Air Transport Association|IATA]]: %s',
		icao           = '[[Internationale Zivilluftfahrt-Organisation|ICAO]]: %s',
		lastedit       = 'letzte Änderung: %s',
		lasteditNone   = 'keine Angabe',
		maybeOutdated  = '(Angaben möglicherweise veraltet)[[Category:VCard: Angaben veraltet]]',
		mobile         = 'Mobil: %s',
		payment        = 'Akzeptierte Zahlungsarten: %s',
		phone          = '<abbr title="Telefon">Tel.</abbr>: %s',
		price          = 'Preis: %s',
		skype          = 'Skype: %s',
		socialStyle    = 'padding: 0 0 0 0.2em;',
		subtype        = 'Merkmal: %s.',
		subtypes       = 'Merkmale: %s.',
		subtypeAbbr    = '<abbr title="%s">%s</abbr>',
		subtypeFile    = '[[File:%s|x14px|link=|class=noviewer|%s]]',
		subtypeSpan    = '<span title="%s">%s</span>',
		subtypeWithCount = '%d %s',
		tollfree       = '<abbr title="Telefon">Tel.</abbr> gebührenfrei: %s'
	},

	-- Maintenance
	maintenance = {
		-- general
		commonscat     = '[[Category:VCard: Parameter commonscat benutzt]]',
		commonscatWD   = '[[Category:VCard: Parameter commonscat zusammen mit Wikidata benutzt]]',
		dmsCoordinate  = '[[Category:VCard: DMS-Koordinate]] <span class="listing-check-recommended" style="display:none;">DMS-Koordinate</span>',
		duplicateAliases = ' [[Category:VCard: Doppelte Aliase]]<span class="error">Doppelte Aliase: %s</span>',
		groupUsed      = '[[Category:VCard: Parameter group benutzt]]',
		illegalCtrls   = '[[Category:VCard: Parameter mit unerlaubten Steuerzeichen]] <span class="error">Parameter mit unerlaubten Steuerzeichen</span>',
		urlIsSocialMedia = '[[Category:VCard: URL stammt von Social-Media-Dienst]] <span class="error">URL stammt von Social-Media-Dienst</span>',
		labelFromWD    = '[[Category:VCard: Label aus Wikidata]] <span class="listing-check-recommended" style="display:none;">Label aus Wikidata</span>',
		linkToOtherWV  = '[[Category:VCard: Anderes Wikivoyage verlinkt]]',
		localNameFromWD = '[[Category:VCard: Lokaler Name aus Wikidata bezogen]]',
		malformedName  = '[[Category:VCard: Fehlerhafter Name]] <span class="error">Fehlerhafter Name</span>',
		missingImg     = '[[Category:VCard: Datei existiert nicht]] <span class="error">Nicht vorhandenes Bild: %s</span>',
		missingName    = 'Name fehlt',
		missingNameMsg = '[[Category:VCard: Ohne Namen]] <span class="error">Name fehlt</span>',
		missingType    = '[[Category:VCard: Typ fehlt]] <span class="error">Fehlender Typ</span>',
		nameFromWD     = '[[Category:VCard: Name aus Wikidata bezogen]] <span class="error">Name aus Wikidata bezogen</span>',
		nameWithStar   = '[[Category:VCard: Name enthält Stern]] <span class="error">Name enthält Stern</span>',
		outdated       = '[[Category:VCard: Ereignis veraltet]] <span class="error">Ereignis veraltet</span>',
		parameters     = { 'nameExtra', 'wikipedia' }, -- group
		parameterUsed  = '[[Category:VCard: Parameter %s benutzt]]',
		properties     = '[[Category:Seiten, die die Wikidata-Eigenschaft %s benutzen]]',
		showPoiUsed    = '[[Category:VCard: show=poi benutzt]]',
		type           = '[[Category:Seiten mit dem Markertyp %s]]',
		typeFromWD     = '[[Category:VCard: Typ aus Wikidata bezogen]]',
		typeFromWDchain= '[[Category:VCard: Typ aus Wikidata-Kette bezogen]] <span class="listing-check-recommended" style="display:none;">Typ aus Wikidata bezogen</span>',
		typeIsGroup    = '[[Category:VCard: Typ ist Gruppenbezeichnung]] <span class="listing-check-recommended" style="display:none;">Typ ist Gruppenbezeichnung</span>',
		typeIsColor    = '[[Category:VCard: Typ ist Farbbezeichnung]] <span class="listing-check-recommended" style="display:none;">Typ ist Farbbezeichnung</span>',
		unknownGroup   = '[[Category:VCard: Unbekannte Gruppe]] <span class="error">Unbekannte Gruppe</span>',
		unknownLanguage= '[[Category:VCard: Lokale Sprache unbekannt]] <span class="listing-check-recommended" style="display:none;">Lokale Sprache unbekannt</span>',
		unknownParam   = ' <span class="error">Unbekannter Parameter: %s</span>',
		unknownParams  = ' <span class="error">Unbekannte Parameter: %s</span>',
		unknownType    = '[[Category:VCard: Unbekannter Typ]] <span class="error">Unbekannter Typ</span>',
		wikidata       = '[[Category:VCard: Einsatz von Wikidata]]',
		wrongCoord     = '[[Category:VCard: Fehlerhafte Koordinate]] <span class="error">Fehlerhafte Koordinate</span>',
		wrongImgName   = '[[Category:VCard: Fehlerhafter Mediendateiname]] <span class="error">Fehlerhafter Mediendateiname</span>',
		wrongParam     = '[[Category:%s: Unbekannte Parameter]]',
		wrongQualifier = '[[Category:VCard: Fehlerhafter Wikidata-Qualifikator]] <span class="error">Fehlerhafter Wikidata-Qualifikator</span>',

		urlWithIP      = '[[Category:URL enthält IP-Adresse]] <span class="listing-check-recommended" style="display:none;">URL enthält IP-Adresse</span>',
		urlWithQuery   = '[[Category:URL mit Abfrage]] <span class="listing-check-recommended" style="display:none;">URL mit Abfrage</span>',
		wrongUrl       = '[[Category:URL ist ungültig]] <span class="error">URL ist ungültig</span>',

		-- Marker module
		closeX         = '[[File:Close x - white.png|15px|link=|class=noviewer|Unbekanntes Marker-Symbol]]',
		missingCoord   = '[[Category:Marker: Ohne Koordinaten]] <span class="error">Länge und/oder Breite fehlt</span>',
		numberUsed     = '[[Category:Marker: Nummer manuell vergeben]]',
		poiMode        = '[[Category:Marker: POI-Modus-Format eingesetzt]]',
		unknownFormat  = '[[Category:Marker: Unbekanntes Format]] <span class="error">Unbekanntes Format</span>',
		unknownIcon    = '[[Category:Marker: Unbekanntes Symbol]]',

		-- vCard / Listing module
		commentFromWD  = '[[Category:VCard: Kommentare aus Wikidata]]',
		countryFromWD  = '[[Category:VCard: Länderdaten aus Wikidata]]',
		descrDiv       = '[[Category:VCard: Beschreibung im div-Tag]]',
		inlineSelected = '[[Category:VCard: show=inline gesetzt]]',
		missingCoordVc = '[[Category:VCard: Ohne Koordinaten]]',
		paymentUsed    = '[[Category:VCard: Zahlungsarten spezifiziert]]',
		socialUrlUsed  = '[[Category:VCard: Social-Media-URL verwendet]] <span class="listing-check-recommended">%s-URL verwendet</span>',
		unitFromWD     = '[[Category:VCard: Einheit aus Wikidata]] <span class="listing-check-recommended">Einheit aus Wikidata</span>',
		unknownLabel   = '[[Category:VCard: Unbekanntes Label oder Id]]',
		unknownShow    = '[[Category:VCard: Unbekannter Wert für show]] <span class="error">Wert(e) für show unbekannt: %s</span>',
		unknownSubtype = '[[Category:VCard: Unbekannter Wert für subtype]] <span class="error">Wert(e) für subtype unbekannt: %s</span>',
		unknownUnit    = '[[Category:VCard: Unbekannte Einheit]] <span class="listing-check-recommended">Unbekannte Einheit</span>',
		unknowWDfeatures = '[[Category:VCard: Unbekannte Wikidata-Merkmale]] <span class="listing-check-recommended">Unbekannte Wikidata-Merkmale</span>',
		wrongDate      = '[[Category:VCard: Fehlerhaftes Datum]] <span class="error">Fehlerhaftes Datum</span>',
		wrongSocialId  = '[[Category:VCard: Fehlerhafte Social-Media-Id]] <span class="error">Fehlerhafte %s-Id</span>',
		wrongSocialUrl = '[[Category:VCard: Fehlerhafte Social-Media-URL]] <span class="error">Fehlerhafte %s-URL</span>'
	},

	-- heritage articles by continent, taken from Module:Unesco/i18n
	articles = {
		af      = 'Welterbe/Afrika', -- africa
		am      = 'Welterbe/Amerika', -- america
		as      = 'Welterbe/Asien und Ozeanien', -- asia
		au      = 'Welterbe/Asien und Ozeanien', -- australia
		eu      = 'Welterbe/Europa', -- europe
		na      = 'Welterbe/Amerika', -- north america
		oc      = 'Welterbe/Asien und Ozeanien', -- oceania
		sa      = 'Welterbe/Amerika', -- south america
		default = 'Welterbe'
	},

	-- image titles by continent, taken from Module:Unesco/i18n
	imgTitles = {
		af      = 'Unesco-Welterbestätten in Afrika',
		am      = 'Unesco-Welterbestätten in Amerika',
		as      = 'Unesco-Welterbestätten in Asien',
		au      = 'Unesco-Welterbestätten in Australien',
		eu      = 'Unesco-Welterbestätten in Europa',
		na      = 'Unesco-Welterbestätten in Nordamerika',
		oc      = 'Unesco-Welterbestätten in Ozeanien',
		sa      = 'Unesco-Welterbestätten in Südamerika',
		default = 'Unesco-Welterbestätten'
	},

	-- Icon images
	icons = {
		commons    = '[[File:Commons-logo.svg|x16px|text-bottom|link=|class=noviewer|%s im Medienverzeichnis Wikimedia Commons]]',
		facebook   = '[[File:F_icon.svg|16px|text-bottom|link=|class=noviewer|%s auf Facebook]]',
		flickr     = '[[File:Flickr.svg|x16px|text-bottom|link=|class=noviewer|%s auf Flickr]]',
		google     = '[[File:Google plus.svg|16px|text-bottom|link=|class=noviewer|%s auf Google Plus]]',
		instagram  = '[[File:Instagram icon.png|16px|text-bottom|link=|class=noviewer|%s auf Instagram]]',
		internet   = '[[File:Applications-internet.svg|16px|text-bottom|link=|class=noviewer|Website dieser Einrichtung]]',
		rss        = '[[File:Feed-icon.svg|16px|text-bottom|link=|class=noviewer|RSS-Web-Feed dieser Einrichtung]]',
		twitter    = '[[File:Twitter Logo Mini.svg|16px|text-bottom|link=|class=noviewer|%s auf Twitter]]',
		unesco     = '[[File:WV-Unesco-icon-small.svg|15px|text-bottom|class=noviewer|%s]]',
		wikidata   = '[[File:Wikidata-logo.svg|16px|middle|link=|class=noviewer|%s (%s) in der Datenbank Wikidata]]',
		wikipedia  = '[[File:Antu wikipedia.svg|16px|text-bottom|link=|class=noviewer|%s in der Enzyklopädie Wikipedia]]',
		wikivoyage = '[[File:Wikivoyage-Logo-v3-icon.svg|16px|text-bottom|link=|class=noviewer|%s im Reiseführer Wikivoyage in einer anderen Sprache]]',
		youtube    = '[[File:Logoyoutube2011favicon.svg|x16px|text-bottom|link=|class=noviewer|%s auf YouTube]]'
	},

	-- social media services
	services = {
		{ key = 'facebook',  url = 'https://www.facebook.com/%s', pattern = '^[-.%d%w]+$' },
		{ key = 'flickr',    url = 'https://www.flickr.com/photos/%s', pattern = '^%d%d%d%d%d+@N%d%d$' },
		{ key = 'instagram', url = 'https://www.instagram.com/%s/', pattern = { '^[0-9a-z_][0-9a-z._]+[0-9a-z_]$', '^explore/locations/%d+$' } },
		{ key = 'twitter',   url = 'https://twitter.com/%s', pattern = '^[0-9A-Za-z_]+$' },
		{ key = 'youtube',   url = 'https://www.youtube.com/channel/%s', pattern = '^UC[-_0-9A-Za-z]+[AQgw]$' }
	},

	-- URL query exception patterns
	queryExceptions =
		{ '%.php%?', '%.cfm%?', '%.aspx?%?', '%?ids?=', '%?lang=', '%?page_id=', '%?pageID=' },

	-- Marker name styles
	nameStyles = {
		italic  = 'font-weight: normal; font-style: italic;',
		kursiv  = 'font-weight: normal; font-style: italic;', -- de: kursiv = italic
		normal  = 'font-weight: normal; font-style: normal;',
		station = 'font-weight: normal; white-space: nowrap; background: #f4f4f4; border: 1px solid #ddd; padding-left: 2px; padding-right: 2px;'
	},

	-- For mb.generateTableTypeList
	types = {
		group   = 'Gruppe',  -- type translations
		label   = 'Beschriftung',
		type    = 'Typ'
	},

	-- Language-dependent sorting substitutes
	substitutes = {
		{ l = 'ä', as = 'a' },
		{ l = 'ö', as = 'o' },
		{ l = 'ü', as = 'u' },
		{ l = 'ß', as = 'ss' }
	}
}