Module:User:Isomorphyc/links-draft/templates

Hello, you have come here looking for the meaning of the word Module:User:Isomorphyc/links-draft/templates. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Isomorphyc/links-draft/templates, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Isomorphyc/links-draft/templates in singular and plural. Everything you need to know about the word Module:User:Isomorphyc/links-draft/templates you have here. The definition of the word Module:User:Isomorphyc/links-draft/templates will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Isomorphyc/links-draft/templates, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This is a private module sandbox of Isomorphyc, for their own experimentation. Items in this module may be added and removed at Isomorphyc's discretion; do not rely on this module's stability.


local m_links = require("Module:User:Isomorphyc/links-draft")

local export = {}

-- Used in ] and ]
function export.l_term_t(frame)
	local face = frame.args
	local allowSelfLink = frame.args; allowSelfLink = not allowSelfLink or allowSelfLink == ""
	
	local params = {
		 = {required = true},
		 = {},
		 = {},
		 = {alias_of = "gloss"},
		 = {list = true},
		 = {},
		 = {},
		 = {},
		 = {},
		 = {alias_of = "gloss"},
		 = {},
		 = {},
		 = {},
	}
	
	-- Compatibility mode for {{term}}.
	-- If given a nonempty value, the function uses lang= to specify the
	-- language, and all the positional parameters shift one number lower.
	local compat = (frame.args or "") ~= ""
	
	if compat then
		params = {},
		table.remove(params, 1)
	end
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = args
	
	-- Tracking for missing language or und
	if not lang then
		require("Module:debug").track("link/no lang")
	elseif lang == "und" then
		require("Module:debug").track("link/und")
	end
	
	lang = lang or "und"
	local sc = args
	
	local term = args
	local alt = args
	
	-- Check parameters
	lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
	sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
	
	if not term and not alt and frame.args then
		term = frame.args
	end
	
	-- Forward the information to full_link
	return m_links.full_link({lang = lang, sc = sc, term = term, alt = alt, id = args, tr = args, pr = args, genders = args, gloss = args, pos = args, lit = args}, face, allowSelfLink)
end

function export.ll(frame)
	local args = frame:getParent().args
	local allowSelfLink = args; allowSelfLink = not allowSelfLink or allowSelfLink == ""
	
	local lang = args
	lang = require("Module:User:Isomorphyc/languages-draft").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
	
	local text = args
	local alt = args
	if text == "" then return alt or "" end
	if alt == "" then alt = nil end
	
	local id = args; if id == "" then id = nil end
	
	return m_links.language_link(text, alt, lang, id, allowSelfLink)
end

function export.def_t(frame)
	local params = {
		 = {required = true, default = ""},
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	return m_links.english_links(args)
end

return export