<?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</id>
	<title>Modul:Wikidata/Formatters - 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"/>
	<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters&amp;action=history"/>
	<updated>2026-05-13T19:42:25Z</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&amp;diff=183&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&amp;diff=183&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-182:rev-183 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sneedmaster</name></author>
	</entry>
	<entry>
		<id>https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters&amp;diff=182&amp;oldid=prev</id>
		<title>wp&gt;Legoktm: Replacing Module:No globals with require(&#039;strict&#039;) (more info) #noglobals</title>
		<link rel="alternate" type="text/html" href="https://wiki.czchan.org/w/index.php?title=Modul:Wikidata/Formatters&amp;diff=182&amp;oldid=prev"/>
		<updated>2026-01-06T00:41:01Z</updated>

		<summary type="html">&lt;p&gt;Replacing Module:No globals with require(&amp;#039;strict&amp;#039;) (&lt;a href=&quot;https://meta.wikimedia.org/wiki/User:Legoktm/No_globals&quot; class=&quot;extiw&quot; title=&quot;m:User:Legoktm/No globals&quot;&gt;more info&lt;/a&gt;) #noglobals&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;
p.Formatters = {}&lt;br /&gt;
setmetatable(p.Formatters, {&lt;br /&gt;
	__index = function(t, key)&lt;br /&gt;
		t[key] = require(&amp;#039;Modul:Wikidata/Formatters/&amp;#039; .. key)&lt;br /&gt;
		return t[key]&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
local lib = require &amp;#039;Modul:Wikidata/lib&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local function formatSpecial(snaktype, options)&lt;br /&gt;
	local i18n = mw.loadData(&amp;#039;Modul:Wikidata/i18n&amp;#039;)&lt;br /&gt;
	return options[snaktype] or i18n[snaktype] -- todo: přeložit pomocí hlášení&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getRawValue(snak, options)&lt;br /&gt;
	if snak.snaktype == &amp;#039;somevalue&amp;#039; or snak.snaktype == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
		return snak.snaktype&lt;br /&gt;
	elseif snak.snaktype ~= &amp;#039;value&amp;#039; then&lt;br /&gt;
		return error(lib.formatError(&amp;#039;unknown-snak-type&amp;#039;, snak.snaktype))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return p.Formatters[snak.datavalue.type].getRawValue(snak.datavalue.value, options or {})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatRawValue(value, formatter, options)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	if value == &amp;#039;somevalue&amp;#039; or value == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
		return formatSpecial(value, options)&lt;br /&gt;
	else&lt;br /&gt;
		return p.Formatters[formatter].formatRawValue(value, options)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getFormattedValue(snak, options)&lt;br /&gt;
	if snak.snaktype == &amp;#039;somevalue&amp;#039; or snak.snaktype == &amp;#039;novalue&amp;#039; then&lt;br /&gt;
		return formatSpecial(snak.snaktype, options)&lt;br /&gt;
	elseif snak.snaktype ~= &amp;#039;value&amp;#039; then&lt;br /&gt;
		return error(lib.formatError(&amp;#039;unknown-snak-type&amp;#039;, snak.snaktype))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local formatter = options[&amp;#039;value-formatter&amp;#039;] or snak.datavalue.type&lt;br /&gt;
	if formatter == &amp;#039;built-in&amp;#039; then&lt;br /&gt;
		return mw.wikibase.formatValue(snak)&lt;br /&gt;
	else&lt;br /&gt;
		return p.Formatters[formatter].formatValue(snak.datavalue.value, options)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wp&gt;Legoktm</name></author>
	</entry>
</feed>