Module:Language info

---Split the `str` on each `div` in it and return the result as a table. ---Original version credit: http://richard.warburton.it. ---@param div string ---@param str string ---@return table|boolean local function explode(div,str) if (div=='') then return false end local pos,arr = 0,{} -- for each divider found for st,sp in function return string.find(str,div,pos,true) end do		arr[#arr + 1] = string.sub(str,pos,st-1) -- Attach chars left of current divider pos = sp + 1 -- Jump past current divider end arr[#arr + 1] = trim(string.sub(str,pos)) -- Attach chars right of last divider return arr end

return { interwiki_links = function(frame) local key = frame.args[1] local lang = frame.args[2] local offwiki = explode(', ', frame.args[3]) local info = {} for _,v in pairs(offwiki) do -- We only invoke this module once per page, therefore we do not need to use mw.loadData, require is faster. info[v] = require("Module:Language info/data-"..v)		end end, }