Module:add etymology: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Created page with "local export = {} local getArgs = require("Module:Arguments").getArgs local m_languages = require("Module:languages") function export.format(frame) local args = getArgs(frame) local current = mw.title.makeTitle("", args["entry"] or "") or mw.title.getCurrentTitle() local language = m_languages.get_by_code(args[1]) local content = current:getContent() content = mw.ustring.match(content, "(==%s*" .. language.name .. "%s*==.+)\n==[^=]+==\n") or mw.ustring.match(...")
 
No edit summary
Line 30: Line 30:
end
end
if etymology_i > 2 then --if already set up for multiple etymologies
if args[2] == "format" then --if just wanting to format
return content
elseif etymology_i > 2 then --if already set up for multiple etymologies
return content .. "\n\n=== {{Etymology|" .. language.code .. "|" .. etymology_i .. "}} ==="
return content .. "\n\n=== {{Etymology|" .. language.code .. "|" .. etymology_i .. "}} ==="
elseif args[2] == "format" then --if just wanting to format
return content
end
end