localexport={}functionexport.exists(frame,fallback)localargs=frame.argslocallang=args[1]orerror("Wikimedia language code has not been specified. Please pass parameter 1 to the module invocation.")lang=require("Module:wikimedia languages")[(fallbackand"getByCodeWithFallback"or"getByCode")](lang)iflangthenreturn"1"elsereturn""endendfunctionexport.existsWithFallback(frame)returnexport.exists(frame,true)endfunctionexport.getByCode(frame,fallback)localargs=frame.argslocallangcode=args[1]orerror("Wikimedia language code has not been specified. Please pass parameter 1 to the module invocation.")localitemname=args[2]orerror("Type of information to look up has not been specified. Please pass parameter 2 to the module invocation.")locallang=require("Module:wikimedia languages")[(fallbackand"getByCodeWithFallback"or"getByCode")](langcode)ifnotlangthenerror("The wikimedia language code '"..langcode.."' is not valid.")end-- The item that the caller wanted to look upifitemname=="getAllNames"thenlocalindex=args[3];ifindex==""thenindex=nilendindex=tonumber(indexorerror("Please specify the numeric index of the desired name."))returnlang:getAllNames()[index]or""elseifitemname=="getWiktionaryLanguage"thenreturnlang:getWiktionaryLanguage():getCode()elseiflang[itemname]thenlocalret=lang[itemname](lang)iftype(ret)=="string"thenreturnretelseerror("The function \""..itemname.."\" did not return a string value.")endelseerror("Requested invalid item name \""..itemname.."\".")endendfunctionexport.getByCodeWithFallback(frame)returnexport.getByCode(frame,true)endreturnexport