Module:redlink category

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

I want to repurpose this for categorising redlinked form-of entries, but it hasn't been done yet.

Initially I will make it functional for English only, on pages with >6 characters in the title, to try and minimise the risk of Lua errors.

This, that and the other (talk)

information Do not use

local export = {}

local rmatch = mw.ustring.match

function export.cat(frame)
	local redlink_category = ""

	local m_languages = require("Module:languages")
	local code = frame.args -- language code
	local template = frame.args

	local lang = m_languages.getByCode(frame.args)
	local sc = lang:findBestScript(frame.args)
	local is_linked, entry = pcall(require("Module:links").get_link_page, frame.args, lang, sc) -- entry name (parameter 2 in Template:m, Template:l)

	local link_object = mw.title.new(entry)
	
	-- Prevent an expensive parser function error. Unfortunately, we can't check
	-- the expensive parser function count before running the preceding code
	-- in this function.
	local success, exists
	if link_object then
		success, exists = pcall(function () return link_object.exists end)
	end

	if success and not exists then
		local langname = lang:getCanonicalName()
		
		redlink_category = "]"
		if template and template ~= "-" then
			redlink_category = redlink_category .. "]"
		end
	end
	if is_linked then -- a blank terms (i.e. those intended to be unlinked) still seem to invoke this module, so we don't want to add them to the category
		return redlink_category
	else
		return ""
	end

end

return export