Module:MagazineVariables

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Revision as of 17:52, 25 July 2023 by HudgynS (talk | contribs)
Jump to navigation Jump to search

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