Module:ChapterVariables
Jump to navigation
Jump to search
Documentation for this module may be created at Module:ChapterVariables/doc
local p = {}
function p.main( frame )
local chapterVariablesText = frame.args[1]
if frame.args[2] == "nil" then
local chapterVariablesData = mw.loadData( 'Module:ChapterVariables/data' )
else
local chapterVariablesData = mw.loadData( 'Module:ChapterVariables/data/' .. frame.args[2] )
end
return chapterVariablesData[chapterVariablesText] or chapterVariablesText or ""
end
function p.jptext( frame )
local chapterVariablesText = frame.args[1]
local chapterVariablesData = mw.loadData( 'Module:ChapterVariables/dataJ' )
local chapterVariablesReturn = frame:preprocess(chapterVariablesData[chapterVariablesText])
if chapterVariablesReturn == "nil" then
chapterVariablesReturn = chapterVariablesText
end
return chapterVariablesReturn or chapterVariablesText or ""
end
function p.romaji( frame )
local chapterVariablesText = frame.args[1]
local chapterVariablesData = mw.loadData( 'Module:ChapterVariables/dataR' )
return chapterVariablesData[chapterVariablesText] or chapterVariablesText or ""
end
function p.russian( frame )
local chapterVariablesText = frame.args[1]
local chapterVariablesData = mw.loadData( 'Module:ChapterVariables/dataRu' )
return chapterVariablesData[chapterVariablesText] or chapterVariablesText or ""
end
return p