Module:cognates: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
nocap = false,
nocap = false,
nocat = false,
nocat = false,
nopre = false,
}
}
Line 49: Line 50:
for _, lang in ipairs(langs) do
for _, lang in ipairs(langs) do
local term, data = m_inline.parse(args[lang])
local term, data = m_inline.parse(args[lang])
data[1], data[2] = lang, term
data[1], data[2], data["nobold"] = lang, term, true
local link = frame:expandTemplate{title = "m+", args = data}
local pre = data["pre"]
if nat and params.nocat == false then link = link .. "[[Category:" .. nat.name .. " terms with " .. m_languages.get_by_code(lang).name .. " cognates]]" end
if pre then
pre = pre .. " "
data["pre"] = nil
end
local link = (pre or "") .. frame:expandTemplate{title = "m+", args = data}
if nat and params.nocat == false then link = link .. "[[Category:" .. nat.name .. " terms with " .. m_languages.get_by_code(lang).name .. " cognates|" .. mw.title.getCurrentTitle().subpageText .. "]]" end
table.insert(links, link)
table.insert(links, link)
end
end
local text = ((params.nocap and "c") or "C") .. "ognate with "
local text = ((not params.nopre) and ((params.nocap and "c") or "C") .. "ognate with ") or ""
for i, link in ipairs(links) do
for i, link in ipairs(links) do