localexport={}localrmatch=mw.ustring.matchfunctionexport.cat(frame)localredlink_category=""localm_languages=require("Module:languages")localcode=frame.args[1]-- language codelocaltemplate=frame.args["template"]locallang=m_languages.getByCode(frame.args[1])localsc=lang:findBestScript(frame.args[2])localis_linked,entry=pcall(require("Module:links").get_link_page,frame.args[2],lang,sc)-- entry name (parameter 2 in Template:m, Template:l)locallink_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.localsuccess,existsiflink_objectthensuccess,exists=pcall(function()returnlink_object.existsend)endifsuccessandnotexiststhenlocallangname=lang:getCanonicalName()redlink_category="[[หมวดหมู่:หน้าที่มีลิงก์แดงภาษา"..langname.."]]"iftemplateandtemplate~="-"thenredlink_category=redlink_category.."[[หมวดหมู่:หน้าที่มีลิงก์แดงภาษา"..langname.."/"..template.."]]"endendifis_linkedthen-- 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 categoryreturnredlink_categoryelsereturn""endendreturnexport