Module:City
From Neodyland Wiki
More actions
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 (not place) or (place == "") then
return nil
end
if string.match(place, "Q%d+") then
item = place
else
item = data[mw.ustring.lower(place)]
end
if not item then
return place
end
if (not link) or (mw.text.trim(link) == "") then
link = "wikipedia"
end
return wikidata._getLabel(item, {lang = lang, link = link})
end
function p.city(frame)
local args = frame.args
return p._city(args[1], args.lang, args.link)
end
return p