Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 07:40, 26 July 2016 by commons>Zolo (Created page with 'local p = {} local data = mw.loadData("Module:City/data") local wikidata = require "Module:Wikidata" function p._city(place, lang, link) local item if strin...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation[ create · purge ]
This documentation is transcluded from Module:City/doc.
local p = {}

local data = mw.loadData("Module:City/data")
local wikidata = require "Module:Wikidata"

function p._city(place, lang, link)
	local item
	if string.match(place, "Q%d+") then
		item = place
	else
		item = data[place]
	end
	if not item then
		return place
	end
	return wikidata.getLabel{{entity = item, lang = lang, link = link or "wikipedia"}}
end

function p.city(city)
	local args = frame.args
	return p._city(args[1], args[lang], args[link])
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.