コンテンツにスキップ

モジュール:families/templates

出典: フリー多機能辞典『ウィクショナリー日本語版(Wiktionary)』

このモジュールについての説明文ページを モジュール:families/templates/doc に作成できます

local export = {}

function export.exists(frame)
	local args = frame.args
	local fam = args[1] or error("Family code has not been specified. Please pass parameter 1 to the module invocation.")
	
	fam = require("モジュール:families").getByCode(fam)
	
	if fam then
		return "1"
	else
		return ""
	end
end

function export.getByCode(frame)
	local args = frame.args
	local fam = args[1] or error("Family code (parameter 1) has not been specified.")
	fam = require("モジュール:families").getByCode(fam) or error("The family code '" .. fam .. "' is not valid.")

	return require("モジュール:language-like").templateGetByCode(fam, args)
end

function export.getByCanonicalName(frame)
	local args = frame.args
	local famname = args[1] or error("Family name has not been specified. Please pass parameter 1 to the module invocation.")
	
	local fam = require("モジュール:families").getByCanonicalName(famname)
	
	if fam then
		return fam:getCode()
	else
		return ""
	end
end

return export