Modul:Wikidata/Formatters/flag

Z Wikipedie, otevřené encyklopedie

Dokumentaci tohoto modulu lze vytvořit na stránce Modul:Wikidata/Formatters/flag/Dokumentace

require 'Modul:No globals'

local parent = require 'Modul:Wikidata/Formatters/wikibase-entityid'

local p = {}

p.getRawValue = parent.getRawValue

function p.formatValue(value, options)
	return p.formatRawValue(p.getRawValue(value, {}), options)
end

function p.formatRawValue(value, options)
	local sitelink = mw.wikibase.getSitelink(value)
	if sitelink then
		return mw.getCurrentFrame():expandTemplate{ title = 'Vlajka a název', args = { sitelink } }
	else
		return parent.formatRawValue(value, options)
	end
end

return p