Module:fi-colonlink

From Wiktionary, the free dictionary
Jump to navigation Jump to search

local export = {}

function export.link(frame)
	local lang = require("Module:languages").getByCode("fi")
	local sc = require("Module:scripts").getByCode("Latn")

	local text = frame:getParent().args[1] or error("Argument 1 is required")
	local ok, _, wllang = mw.ustring.find(text, "^(%a-):")
	
	if ok and mw.site.interwikiMap("local")[mw.ustring.lower(wllang)] then
		return require("Module:links").full_link{
			term = "Unsupported titles/" .. text,
			alt = text,
			lang = lang,
			sc = sc
		}
	end
	return require("Module:links").full_link{
		term = text,
		lang = lang,
		sc = sc
	}
end

return export