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

Allows templates to access information about namespaces from mw.site.namespaces. Namespaces can be accessed by name or id (number). Boolean properties are converted to 1 if true, else the empty string, so that they can be used in {{#if:}}.


local export = {}

local function check(arg, what, n, allow_empty)
	arg = mw.text.trim(arg)
	if not allow_empty and arg == "" then
		arg = nil
	end
	if not arg then
		error("Supply a " .. what .. " as argument " .. n)
	end
	return arg
end

local function get_info(namespace_name_or_id, item)
	local namespace = mw.site.namespaces
	if namespace == nil then
		error("Invalid namespace name or id " .. namespace_name_or_id)
	end
	local datum = namespace
	if datum == nil then
		error("Invalid data item " .. item)
	end
	return datum
end

function export.info(frame)
	local namespace_name_or_id = check(frame.args, "namespace", 1, true)
	if not namespace_name_or_id then
		error("Supply a namespace as argument 1")
	end
	namespace_name_or_id = tonumber(namespace_name_or_id) or namespace_name_or_id
	local item = check(frame.args, "item to look up", 1)
	local datum = get_info(namespace_name_or_id, item)
	if type(datum) == "boolean" then
		return datum and "1" or ""
	elseif not (type(datum) == "string" or type(datum) == "number") then
		error("Unimplemented")
	end
end

return export