localexport={}-- Look up an item from the table of language data, and return it.-- This function allows templates to access this data.-- Returns an empty string if the item does not exist.functionexport.lookup_language(frame)locallanguages=mw.loadData("Module:languages")localargs=frame.argslocallang=args[1]orerror("Language code has not been specified. Please pass parameter 1 to the module invocation.")locallanginfo=languages[lang]orerror("The language code \""..lang.."\" is not valid.")-- The item that the caller wanted to look uplocalitemname=args[2]orerror("Type of information to look up has not been specified. Please pass parameter 2 to the module invocation.")localitem=langinfo[itemname]or""iftype(item)=="table"thenreturnitem[tonumber(args[3]or1)]or""elsereturnitemor""endendfunctionexport.lookup_family(frame)localfamilies=mw.loadData("Module:families")localargs=frame.argslocalfam=args[1]orerror("Family code has not been specified. Please pass parameter 1 to the module invocation.")localfaminfo=families[fam]orerror("The family code \""..fam.."\" is not valid.")-- The item that the caller wanted to look uplocalitemname=args[2]orerror("Type of information to look up has not been specified. Please pass parameter 2 to the module invocation.")localitem=faminfo[itemname]or""iftype(item)=="table"thenreturnitem[tonumber(args[3]or1)]or""elsereturnitemor""endendfunctionexport.language_exists(frame)locallanguages=mw.loadData("Module:languages")localargs=frame.argslocallang=args[1]orerror("Language code has not been specified. Please pass parameter 1 to the module invocation.")iflanguages[lang]thenreturn"1"elsereturn""endendfunctionexport.family_exists(frame)localfamilies=mw.loadData("Module:families")localargs=frame.argslocalfam=args[1]orerror("Family code has not been specified. Please pass parameter 1 to the module invocation.")iffamilies[fam]thenreturn"1"elsereturn""endendreturnexport