跳转到内容

Module:Marker utilities/i18n

来自维基导游
-- Separating code from internationalization

return {
	-- module administration
	moduleInterface  = {
		suite  = 'Marker utilities',
		sub    = 'i18n',
		serial = '2025-10-08',
		item   = 65441686
	},

	dates            = { yyyymmdd = { p = '^20[0-5]%d%-[01]?%d%-[0-3]?%d$', f = 'Y年Mj日' },
	                     yyyy     = { p = '^20[0-5]%d$', f = 'Y年' },
	                     yy       = { p = '^[0-5]%d$', f = 'Y年' },
	                     mmdd     = { p = '^[01]?%d%-[0-3]?%d$', f = 'Mj日' },
	                     dd       = { p = '^[0-3]?%d%.?$', f = 'j日' },
	                     mm       = { p = '^[01]?%d%.?$', f = 'M' },
	                     lastedit = { f = 'Y年M' },
	                     asOf     = { f = 'n/Y' }
	                   },
	fileExtensions   = { 'tif', 'tiff', 'gif', 'png', 'jpg', 'jpeg', 'jpe',
	                     'webp', 'xcf', 'ogg', 'ogv', 'svg', 'pdf', 'stl',
	                     'djvu', 'webm', 'mpg', 'mpeg' },
	months           = { '1月', '2月', '3月', '4月', '5月', '6月', '7月',
	                     '8月', '9月', '10月', '11月', '12月' },
	monthAbbr        = { '一月', '二月', '三月', '四月', '五月', '六月',
                         '七月', '八月', '九月', '十月', '十一月', '十二月' },

	-- Map related constants
	map = {
		coordURLformat    = '//%s.wikivoyage.org/w/index.php?title=Special%%3AMapsources&params=%s_%s_%s&locname=%s',
		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 properties
	properties = {
		appliesToJurisdiction = 'P1001',
		appliesToPart     = 'P518',
		appliesToPeople   = 'P6001',
		capacity          = 'P1083',
		centerCoordinates = 'P5140',
		commonsCategory   = 'P373',
		coordinates       = 'P625',
		endTime           = 'P582',  -- time
		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',  -- time, for fees
		streetAddress     = 'P6375',
		subclassOf        = 'P279',
		unitSymbol        = 'P5061',
		use               = 'P366',
		validInPeriod     = 'P1264'
	},

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

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

	-- Languages for fallbacks, except wiki language
	langs = {}, -- array can be empty

	-- Display and performance options for vCard / Listing and Marker modules
	-- additional options in Module:VCard/i18n
	options = {
		excludeColorTypes = true,
		normalizeValues   = { 'type', 'subtype', 'show', 'status', 'symbol' },
		noStarParams      = { 'nameExtra', 'nameLocal', 'alt', 'comment' },
		noTypeMsgs        = false, -- prevents display of maintenance( typeFromWD, typeIsGroup )
		parameters        = { 'commonscat', 'country', 'id', 'localLang', 'nameExtra', 'wikipedia' }, -- parameter is used
		showLocalData     = true,  -- names, addresses, directions
		showSisters       = true,  -- possible values true, false, 'atEnd'
		usePropertyCateg  = true,  -- create maintenance categories for Wikidata properties
		useTypeCateg      = true,  -- create maintenance categories for marker types
		markerMetadata    = true,  -- add metadata at marker templates

		-- text limit of content/description parameter
		contentLimit      = 1000,
		groupsWithLimit   = { buy = 1, drink = 1, eat = 1, sleep = 1 },

		-- Wikidata related constants
		searchLimit       = 4,     -- count of levels for P31-P279 search

		-- 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
	},

	-- strings
	texts = {
		asOf           = ';直到%s', -- with semicolon separator
		from           = '自%s始',
		fromTo         = '%s–%s',
		to             = '到%s',
		fromTo2        = '从%s到%s',

		-- General, i18n
		               -- black x-like cross
		closeX         = '[[File:Close x - black.png|15px|link=|class=noviewer|不明标志记号]]',
		missingName    = '缺失名称',
		-- In case of CJK languages no spaces are used with punctuation
		-- Enumeration commas. listing-comma is used for alt names only
		comma          = '<span class="listing-comma">,</span>', -- with zero-width space
		commaSeparator = ',',
		period         = '。',
		periodSeparator= '。',
		-- Space following a punctuation mark
		space          = ' ',
		nbSpace        = '&nbsp;',
		parentheses    = ' (%s)',
		emph           = "“%s”",

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

		-- Anchor id
		anchor         = 'vCard_%s',

		-- Marker
		CategoryNS     = { '[Cc]ategory', '分类', '分類' },
		FileNS         = { '[Ff]ile', '[Ii]mage', '文件', '图像', '圖像' },
		latitude       = '维度',
		longitude      = '经度',
		tooltip        = '点击标记即可直接打开地图。',

		-- vCard / Listing module
		checkin        = '入住:%s',
		checkout       = '离店:%s',
		closed         = '关闭:%s',
		closedPattern  = '^关闭[::]?%s*',
		editInSource   = '编辑源文件',
		email          = 'E-Mail:%s',
		expirationPeriod = 'now - 3 years',
		fax            = '传真:%s',
		hintName       = '本地名称 %s',
		hintLatin      = '拉丁文转写名称',
		hintAddress    = '当地语言转写地址 %s',
		hintAddress2   = '地址 %s',
		hintDirections = '当地语言的路线指引 %s',
		hours          = '营业时间:%s',
		iata           = '[[机场代码#IATA代码|IATA]]:%s',
		icao           = '[[机场代码#ICAO代码|ICAO]]:%s',
		lastedit       = '最后更新:%s',
		lasteditNone   = '未指定',
		maybeOutdated  = '(信息可能已过时)[[Category:VCard信息过时]]',
		mobile         = '手机:%s',
		payment        = '接受的付款方式:%s',
		phone          = '电话号码:%s',
		price          = '价格:%s',
		subtype        = '附加信息:%s.',
		subtypes       = '附加信息:%s.',
		subtypeAbbr    = '<abbr title="%s">%s</abbr>',
		subtypeFile    = '[[File:%s|x14px|link=|class=noviewer listing-subtype-icon|%s]]',
		subtypeSpan    = '<span title="%s">%s</span>',
		subtypeWithCount = '%d %s',
		tollfree       = '免费电话:%s'
	},

	-- namespaces without maintenance messages
	nsNoMaintenance = {
		[ 4 ]   = true,
		[ 10 ]  = true,
		[ 12 ]  = true,
		[ 828 ] = true
	},

	-- format strings for mu.addMaintenance
	formats = {
		category = '[[Category:%s]]',
		error    = ' <span class="error">%s</span>',
		hint     = ' <span class="listing-check-recommended" style="display: none;">%s</span>'
	},

	maintenance = {
		-- general
		properties     = '[[Category:使用Wikidata属性%s的页面]]',
		type           = { category = '使用标记类型%s的页面' },
		group          = { category = '使用标记组%s的页面' },

		urlWithIP      = { category = 'URL含IP地址', hint = 'URL含IP地址' },
		wrongUrl       = { category = 'URL无效', err = 'URL无效' },

		commonscatWD   = { category = 'VCard参数commonscat与wikidata同时使用' },
		contentTooLong = { category = 'VCard描述过长', err = '描述过长' },
		currencyTooltip= { category = 'VCard使用货币提示' },
		dmsCoordinate  = { category = 'VCard使用DMS坐标格式', hint = 'DMS坐标格式' },
		duplicateAliases = { category = 'VCard存在重复别名', err = '重复别名:%s' },
		labelFromWD    = { category = 'VCard标签来自Wikidata', hint = '标签来自Wikidata' },
		linkIsRedirect = { category = 'VCard条目链接为重定向页' },
		linkToOtherWV  = { category = 'VCard链接至其他维基导游站点' },
		malformedName  = { category = 'VCard名称格式错误', err = '名称格式错误' },
		missingImg     = { category = 'VCard引用图片不存在', err = '图片不存在:%s' },
		missingNameMsg = { category = 'VCard缺少名称', err = '缺少名称' },
		missingType    = { category = 'VCard缺少类型', err = '缺少类型' },
		nameFromWD     = { category = 'VCard名称取自Wikidata', err = '名称取自Wikidata' },
		nameWithStar   = { category = 'VCard名称含星号', err = '名称含星号' },
		outdated       = { category = 'VCard事件已过期', err = '事件已过期' },
		parameterUsed  = { category = 'VCard使用参数%s' },
		deleteShowCopy = { category = 'VCard中show=copy参数已被移除', hint = 'show=copy已被移除' },
		showInlineUsed = { category = 'VCard设置show=inline' },
		showNoneUsed   = { category = 'Marker设置show=none' },
		showPoiUsed    = { category = 'VCard设置show=poi' },
		typeFromWDchain= { category = 'VCard类型取自Wikidata层级链', hint = '类型取自Wikidata' },
		typeIsGroup    = { category = 'VCard类型为组名', hint = '类型为组名' },
		typeIsColor    = { category = 'VCard类型为颜色名', hint = '类型为颜色名' },
		                 -- typeIsColor is not used if excludeColorTypes = true
		unknownCountry = { category = 'VCard国家代码未知', err = '国家代码未知' },
		unknownGroup   = { category = 'VCard组名未知', err = '组名未知' },
		unknownLanguage= { category = 'VCard语言代码未知', hint = '语言代码未知' },
		unknownParam   = { category = 'VCard含未知参数', err = '未知参数:%s' },
		unknownParams  = { category = 'VCard含多个未知参数', err = '未知参数:%s' },
		unknownPropertyLanguage= { category = 'VCard属性语言代码未知', hint = '属性语言代码未知' },
		unknownStatus  = { category = 'VCard状态未知', err = '状态未知' },
		unknownType    = { category = 'VCard类型未知', err = '类型未知:%s' },
		unusedRedirect = { category = 'VCard存在未使用的重定向站内链接' },
		urlIsSocialMedia = { category = 'VCard链接指向社交媒体平台', err = '链接指向社交媒体平台' },
		wikidata       = { category = 'VCard使用Wikidata数据' },
		wrongCoord     = { category = 'VCard坐标格式错误', err = '坐标格式错误' },
		wrongImgName   = { category = 'VCard媒体文件名错误', err = '媒体文件名错误' },
		wrongQualifier = { category = 'VCardWikidata限定符错误', err = 'Wikidata限定符错误' },

		-- Marker module
		missingCoord   = { category = 'Marker缺少坐标', err = '缺少经度或纬度' },
		numberUsed     = { category = 'Marker编号手动指定' },
		unknownIcon    = { category = 'Marker图标未知' },

		-- vCard / Listing module
		countryFromWD  = { category = 'VCard国家数据来自Wikidata' },
		missingCoordVc = { category = 'VCard缺少坐标' },
		paymentUsed    = { category = 'VCard指定支付方式' },
		socialUrlUsed  = { category = 'VCard使用社交媒体链接', hint = '使用%s链接' },
		unitFromWD     = { category = 'VCard单位来自Wikidata', hint = '单位来自Wikidata' },
		unknownLabel   = { category = 'VCard标签或ID未知' },
		unknownMAKI    = { category = 'VCardMAKI图标未知', hint = 'MAKI图标未知' },
		unknownShow    = { category = 'VCardshow参数值未知', err = 'show参数值未知:%s' },
		unknownSubtype = { category = 'VCardsubtype参数值未知', err = 'subtype参数值未知:%s' },
		unknownUnit    = { category = 'VCard单位未知', hint = '单位未知' },
		unknowWDfeatures = { category = 'VCard含未知Wikidata特性', hint = '含未知Wikidata特性' },
		wdWithGoogleCid = { category = 'VCard参数google-maps与wikidata同时使用', hint = 'google-maps与wikidata同时使用' },
		wikidataWithId = { category = 'VCard参数id与wikidata同时使用', hint = 'id与wikidata同时使用' },
		wrongDate      = { category = 'VCard日期格式错误', err = '日期格式错误' },
		wrongGoogleCid = { category = 'VCardGoogle地图客户ID错误', err = 'Google地图客户ID错误' },
		wrongId        = { category = 'VCardID格式错误', err = 'ID格式错误' },
		wrongSocialId  = { category = 'VCard社交媒体ID错误', err = '%s的ID错误' },
		wrongSocialUrl = { category = 'VCard社交媒体链接错误', err = '%s链接错误' }
	},

	iconTitles = {
		commons    = '%s在维基共享媒体中',
		facebook   = '%s在Facebook上',
		flickr     = '%s在Flickr上',
		instagram  = '%s在Instagram上',
		internet   = '该场所的官方网站',
		maps       = '%s在地图与路线规划服务中',
		rss        = '该场所的RSS网络订阅源',
		tiktok     = '%s在TikTok上',
		twitter    = '%s在X(Twitter)上',
		wikidata   = '%s(%s)在维基数据中',
		wikipedia  = '%s在维基百科中',
		wikivoyage = '%s在其他语言版本的维基导游旅行指南中',
		youtube    = '%s在YouTube上'
	},
	
	-- social media services
	services = {
		{ key = 'facebook',  url = 'https://www.facebook.com/%s', pattern = { '^[-.%d%w][-_.%d%w]+$', '^[^%z\1-,/:-?\91-\94{-~]+/[1-9]%d+$' } },
		{ 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 = 'tiktok',    url = 'https://www.tiktok.com/@%s', pattern = '^[0-9A-Za-z_][0-9A-Za-z_.]+$' },
		{ key = 'twitter',   url = 'https://twitter.com/%s', pattern = '^[0-9A-Za-z_]+$' },
		{ key = 'youtube',   url = { 'https://www.youtube.com/channel/%s', 'https://www.youtube.com/%s' },
			pattern = { '^UC[-_0-9A-Za-z]+[AQgw]$', '^@[-0-9A-Za-z_.][-0-9A-Za-z_.][-0-9A-Za-z_.]+$' } }
	},

	--[[ status symbols
		g: successive symbol group number
		alias: status alias
		label: image tag title
		category = 1: add maintenance category
	--]]
	statuses = {
		['top-hotel']  = { g = 1, label = '顶级酒店', category = 1 },
		['top-restaurant']  = { g = 1, label = '顶级餐厅', category = 1 },
		['top-sight']  = { g = 1, label = '热门景点', category = 1 },
		recommendation = { g = 1, label = 'Empfehlung' },

		none    = { g = 2, alias = 'class-0', label = '未分类' },
		stub    = { g = 2, alias = 'class-1', label = '小作品' },
		outline = { g = 2, alias = 'class-2', label = '大纲条目' },
		usable  = { g = 2, alias = 'class-3', label = '可用条目' },
		guide   = { g = 2, alias = 'class-4', label = '指南条目' },
		star    = { g = 2, alias = 'class-5', label = '明星条目' }
	},

	-- Marker name styles
	-- Colors in Template:VCard/styles.css
	nameStyles = {
		inherit = 'font-weight: inherit; font-style: inherit;',
		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; padding-left: 2px; padding-right: 2px;'
	},

	-- yes/no variants
	yesno = {
		y    = 'y',
		yes  = 'y',
		n    = 'n',
		no   = 'n'
	},

	-- List of currencies without conversion tooltips
	noCurrencyConversion = {
--		all = 1, -- no rate conversion tooltips are shown
		         -- there is no confusion with (uppercase) ALL = "Q125999"
--		EUR = 1  -- local currency
	},

	-- Language-dependent sorting substitutes 中文不使用拉丁语
	substitutes = {
	}
}