<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="cs">
	<id>https://wiki.czchan.org/w/index.php?action=history&amp;feed=atom&amp;title=Modul%3AWikidata%2FFormatters%2Fwikibase-entityid</id>
	<title>Modul:Wikidata/Formatters/wikibase-entityid - Historie editací</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.czchan.org/w/index.php?action=history&amp;feed=atom&amp;title=Modul%3AWikidata%2FFormatters%2Fwikibase-entityid"/>
	<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters/wikibase-entityid&amp;action=history"/>
	<updated>2026-05-13T18:43:52Z</updated>
	<subtitle>Historie editací této stránky</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters/wikibase-entityid&amp;diff=185&amp;oldid=prev</id>
		<title>Sneedmaster: naimportována 1 revize</title>
		<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters/wikibase-entityid&amp;diff=185&amp;oldid=prev"/>
		<updated>2026-02-13T17:44:39Z</updated>

		<summary type="html">&lt;p&gt;naimportována 1 revize&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;cs&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Starší verze&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Verze z 13. 2. 2026, 17:44&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;cs&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Žádný rozdíl)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key nuwiki-nuwiki-:diff:1.41:old-184:rev-185 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sneedmaster</name></author>
	</entry>
	<entry>
		<id>https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters/wikibase-entityid&amp;diff=184&amp;oldid=prev</id>
		<title>wp&gt;Matěj Suchánek: options.text vynutí vlastní popis odkazu</title>
		<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters/wikibase-entityid&amp;diff=184&amp;oldid=prev"/>
		<updated>2024-04-28T09:15:11Z</updated>

		<summary type="html">&lt;p&gt;options.text vynutí vlastní popis odkazu&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nová stránka&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require &amp;#039;strict&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local lib = require &amp;#039;Modul:Wikidata/lib&amp;#039;&lt;br /&gt;
local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local function constructLink(label, link, lang)&lt;br /&gt;
	if link then&lt;br /&gt;
		if label then&lt;br /&gt;
			if lang and lang ~= i18n.lang then&lt;br /&gt;
				return lib.formatTextInLanguage(mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, link, label), lang)&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;#039;[[&amp;#039; .. link .. &amp;#039;|&amp;#039; .. label .. &amp;#039;]]&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;#039;[[&amp;#039; .. link .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if label then&lt;br /&gt;
		if lang and lang ~= i18n.lang then&lt;br /&gt;
			return lib.formatTextInLanguage(label, lang)&lt;br /&gt;
		else&lt;br /&gt;
			return label&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getLabel(entityId, options)&lt;br /&gt;
	local label, lang&lt;br /&gt;
	local Module = require &amp;#039;Modul:Wikidata&amp;#039;&lt;br /&gt;
	--if options.label and lib.isPropertyId(options.label) then&lt;br /&gt;
	if options.label == &amp;#039;short&amp;#039; then&lt;br /&gt;
		local fallback&lt;br /&gt;
		if options.withlang then&lt;br /&gt;
			fallback = {options.withlang, &amp;#039;mul&amp;#039;}&lt;br /&gt;
		else&lt;br /&gt;
			fallback = {i18n.lang, &amp;#039;mul&amp;#039;}&lt;br /&gt;
		end&lt;br /&gt;
		for _, withlang in ipairs(fallback) do&lt;br /&gt;
			label, lang = Module.getRawValueFromLua{&lt;br /&gt;
				id = entityId,&lt;br /&gt;
				property = &amp;#039;P1813&amp;#039;,&lt;br /&gt;
				rank = &amp;#039;valid&amp;#039;,&lt;br /&gt;
				sort = {&amp;#039;rank&amp;#039;},&lt;br /&gt;
				withlang = withlang,&lt;br /&gt;
			}, withlang&lt;br /&gt;
			if label then&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if not label then&lt;br /&gt;
			label = Module.getRawValueFromLua{&lt;br /&gt;
				id = entityId, property = &amp;#039;P835&amp;#039;,&lt;br /&gt;
			} or Module.getRawValueFromLua{&lt;br /&gt;
				id = entityId, property = &amp;#039;P428&amp;#039;,&lt;br /&gt;
			}&lt;br /&gt;
			lang = nil&lt;br /&gt;
		end&lt;br /&gt;
	elseif options.label == &amp;#039;gender&amp;#039; then&lt;br /&gt;
		local gender = Module.getRawValueFromLua{&lt;br /&gt;
			id = options.id,&lt;br /&gt;
			property = &amp;#039;P21&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
		local property = ({&lt;br /&gt;
			Q6581072 = &amp;#039;P2521&amp;#039;,&lt;br /&gt;
			Q1052281 = &amp;#039;P2521&amp;#039;,&lt;br /&gt;
			--Q6581097 = &amp;#039;P3321&amp;#039;,&lt;br /&gt;
		})[gender]&lt;br /&gt;
		if property then&lt;br /&gt;
			local fallback&lt;br /&gt;
			if options.withlang then&lt;br /&gt;
				fallback = {options.withlang}&lt;br /&gt;
			else&lt;br /&gt;
				fallback = {i18n.lang}&lt;br /&gt;
			end&lt;br /&gt;
			for _, withlang in ipairs(fallback) do&lt;br /&gt;
				label, lang = Module.getRawValueFromLua{&lt;br /&gt;
					id = entityId,&lt;br /&gt;
					property = property,&lt;br /&gt;
					rank = &amp;#039;valid&amp;#039;,&lt;br /&gt;
					sort = {&amp;#039;rank&amp;#039;},&lt;br /&gt;
					withlang = withlang,&lt;br /&gt;
				}, withlang&lt;br /&gt;
				if label then&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif options.label == &amp;#039;unitsymbol&amp;#039; then&lt;br /&gt;
		local fallback&lt;br /&gt;
		if options.withlang then&lt;br /&gt;
			fallback = {options.withlang, &amp;#039;en&amp;#039;, &amp;#039;mul&amp;#039;}&lt;br /&gt;
		else&lt;br /&gt;
			fallback = {i18n.lang, &amp;#039;en&amp;#039;, &amp;#039;mul&amp;#039;}&lt;br /&gt;
		end&lt;br /&gt;
		for _, withlang in ipairs(fallback) do&lt;br /&gt;
			label = Module.getRawValueFromLua{&lt;br /&gt;
				id = entityId,&lt;br /&gt;
				property = &amp;#039;P5061&amp;#039;,&lt;br /&gt;
				withlang = withlang,&lt;br /&gt;
			}&lt;br /&gt;
			if label then&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if not label then&lt;br /&gt;
		if options.withlang then&lt;br /&gt;
			label, lang = mw.wikibase.getLabelByLang(entityId, options.withlang), options.withlang&lt;br /&gt;
		else&lt;br /&gt;
			label, lang = mw.wikibase.getLabelWithLang(entityId)&lt;br /&gt;
		end&lt;br /&gt;
		if label then&lt;br /&gt;
			label = mw.text.nowiki(label)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return label, lang&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getSitelink(entityId, options)&lt;br /&gt;
	if lib.IsOptionTrue(options, &amp;#039;nolink&amp;#039;) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local link&lt;br /&gt;
	if options.link then&lt;br /&gt;
		if options.link == &amp;#039;wikidata&amp;#039; then&lt;br /&gt;
			link = entityId&lt;br /&gt;
		else&lt;br /&gt;
			link = mw.wikibase.getSitelink(entityId, options.link)&lt;br /&gt;
		end&lt;br /&gt;
		if link then&lt;br /&gt;
			link = lib.getInterwikiPrefix(options.link) .. link&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		link = mw.wikibase.getSitelink(entityId)&lt;br /&gt;
	end&lt;br /&gt;
	return link&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatEntityId(entityId, options)&lt;br /&gt;
	local options = options or {}&lt;br /&gt;
	local label, lang&lt;br /&gt;
	if options.text then&lt;br /&gt;
		label = options.text&lt;br /&gt;
	else&lt;br /&gt;
		label, lang = getLabel(entityId, options)&lt;br /&gt;
	end&lt;br /&gt;
	local link = getSitelink(entityId, options)&lt;br /&gt;
	return constructLink(label, link, lang) or lib.getLinkWhenNonexistingLabel(entityId)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getRawValue(value, options)&lt;br /&gt;
	if lib.IsOptionTrue(options or {}, &amp;#039;numeric&amp;#039;) then&lt;br /&gt;
		return value[&amp;#039;numeric-id&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
	return value.id&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.formatRawValue = p.formatEntityId&lt;br /&gt;
&lt;br /&gt;
function p.formatValue(value, options)&lt;br /&gt;
	return p.formatEntityId(p.getRawValue(value, {}), options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wp&gt;Matěj Suchánek</name></author>
	</entry>
</feed>