Jump to content

Module:languages/errorGetBy

Wiktionary වෙතින්

මෙම මොඩියුලය සඳහා උපදෙස් පාත්‍රිකාවක් අවශ්‍ය වෙයි.
මෙම මොඩියුලය හා අදාළ අරමුණු සහ භාවිත උපදෙස්, උපදෙස් පිටුව තුළ ලේඛනගත කිරීමට කාරුණික වන්න.

local function get_text(allowEtymLang, allowFamily)
	local list = {"language"}
	if allowEtymLang then
		table.insert(list, "etymology language")
	end
	if allowFamily then
		table.insert(list, "family")
	end
	return mw.text.listToText(list, nil, " or ")
end

local export = {}

function export.code(code, paramForError, allowEtymLang, allowFamily)
	local text = get_text(allowEtymLang, allowFamily) .. " code"
	require("Module:languages/error")(code, paramForError, text)
end

function export.canonicalName(name, allowEtymLang, allowFamily)
	local text = get_text(allowEtymLang, allowFamily) .. " name"
	error("The " .. text .. " \"" .. name .. "\" is not valid.")
end

return export
"https://si.wiktionary.org/w/index.php?title=Module:languages/errorGetBy&oldid=51375" වෙතින් සම්ප්‍රවේශනය කෙරිණි