Module:User:Saph/label check

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

Number of warnings
1
location warning
Module:labels/data/lang/xnn subpage missing in table



local export = {}

-- Provided with all subpages of Module:labels/data/lang, find the
-- discrepancies between them and the table returned by /lang.

function export.show(frame)
	arg = 
	frame.args.arg and frame.args.arg .. "\n" -- slight hack: Lua patterns suck, so an extra newline needs to be tacked on
	or error("Please pass a list of subpages of Module:labels/data/lang.")
	
	local m_data = require("Module:labels/data/lang").langs_with_lang_specific_modules
	local warnings, subpages = {}, {}
	
	local n = 1
	local function ins(...)
		warnings = ...
		n = n + 1
	end
	
	-- Iterate over what is provided, for subpages missing in the table.
	for i in arg:gmatch("(+)\n") do
		subpages = true
		if not m_data then
			local lang = require("Module:languages").getByCode(i)
			local warning = "subpage missing in table" .. ((not lang and ", but language code is invalid") or "")
			ins({ "Module:labels/data/lang/" .. i, warning })
		end
	end
	
	-- Iterate over table to find bogus subpages. Check whether subpage is already
	-- provided, first, so that a bunch of expensive DB checks aren't being done
	-- for no reason.
	for i, _ in pairs(m_data) do
		if not subpages then
			local location = "Module:labels/data/lang"
			if not mw.title.new(location .. "/" .. i).exists then
				ins({ location, "subpage " .. i .. " does not exist" })
			else
				ins({ location, "subpage " .. i .. " exists but was not passed - update arg" } )
			end
		end
	end

	if #warnings == 0 then
		return "; No warnings returned."
	end
	
	local ret = 
	"; Number of warnings: " .. #warnings .. [[ 
	  {| class="wikitable"
	  ! location
	  ! warning
	]]
	
	for _, i in ipairs(warnings) do
		ret = ret .. "\n|-\n| .. "]]\n|" .. i
	end
	
	return ret .. "\n|}"
end

return export