Module:MagazineVariables

Documentation for this module may be created at Module:MagazineVariables/doc

local p = {}

function p.main( frame )
    local magazineVariablesText = frame.args[1]
    local magazineVariablesData = ""
    local magazineVariablesResult = ""
    if frame.args[2] == nil then
	    magazineVariablesData = mw.loadData( 'Module:MagazineVariables/data' )
	else
		magazineVariablesData = mw.loadData( 'Module:MagazineVariables/data/' .. frame.args[2]  )
	end
    if frame.args[2] == 'ja' then
        magazineVariablesResult = frame:preprocess(magazineVariablesData[magazineVariablesText])
    else
        magazineVariablesResult = magazineVariablesData[magazineVariablesText]
    end
    return magazineVariablesResult or magazineVariablesText or ""
end

return p