Module:ChapterVariables

local p = {}

function p.main( frame ) local chapterVariablesText = frame.args[1] local chapterVariablesData = "" local chapterVariablesResult = "" if frame.args[2] == nil then chapterVariablesData = mw.loadData( 'Module:ChapterVariables/data' ) else chapterVariablesData = mw.loadData( 'Module:ChapterVariables/data/' .. frame.args[2] ) end if frame.args[2] == 'ja' then chapterVariablesResult = frame:preprocess(chapterVariablesData[chapterVariablesText]) else chapterVariablesResult = chapterVariablesData[chapterVariablesText] end return chapterVariablesResult or chapterVariablesText or "" end

return p