Module:mg-spel: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 9: Line 9:


local export = {}
local export = {}
local function link(term)
return "[[Contionary:" .. term .. "|" .. term .. "]]"
end


function export.alter(frame)
function export.alter(frame)
Line 42: Line 46:
if e == a and a == s then
if e == a and a == s then
qs = {"Spanish", "Asturian", "Southern"}
qs = {"Spanish", "Asturian", "Southern"}
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. link(e) .. " " .. m_q.format_qualifier(qs) .. "\n")
elseif e == a then
elseif e == a then
table.insert(qs, "Spanish")
table.insert(qs, "Spanish")
table.insert(qs, "Asturian")
table.insert(qs, "Asturian")
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. link(e) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang})
table.insert(ret, "* " .. link(s) .. (lh and ", " .. link(s:gsub("lh", "j")) or "") .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
  .. (lh and ", " .. m_l.full_link({term = s:gsub("lh", "j"), lang = lang}) or "")
  .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
elseif e == s then
elseif e == s then
table.insert(qs, "Spanish")
table.insert(qs, "Spanish")
table.insert(qs, "Southern")
table.insert(qs, "Southern")
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. link(e) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = a, lang = lang}) .. " " .. m_q.format_qualifier({"Asturian"}) .. "\n")
table.insert(ret, "* " .. link(a) .. " " .. m_q.format_qualifier({"Asturian"}) .. "\n")
elseif a == s then
elseif a == s then
table.insert(qs, "Asturian")
table.insert(qs, "Asturian")
table.insert(qs, "Southern")
table.insert(qs, "Southern")
table.insert(ret, "* " .. m_l.full_link({term = a, lang = lang}) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. link(a) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier({"Spanish"}) .. "\n")
table.insert(ret, "* " .. link(e) .. " " .. m_q.format_qualifier({"Spanish"}) .. "\n")
else
else
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier({"Spanish"}) .. "\n")
table.insert(ret, "* " .. link(e) .. " " .. m_q.format_qualifier({"Spanish"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = a, lang = lang}) .. " " .. m_q.format_qualifier({"Asturian"}) .. "\n")
table.insert(ret, "* " .. link(a) .. " " .. m_q.format_qualifier({"Asturian"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang})
table.insert(ret, "* " .. link(s) .. (lh and ", " .. link(s:gsub("lh", "j")) or "") .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
  .. (lh and ", " .. m_l.full_link({term = s:gsub("lh", "j"), lang = lang}) or "")
  .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
end
end
if c ~= term then
if c ~= term then
table.insert(ret, "* " .. m_l.full_link({term = c, lang = lang}) .. " " .. m_q.format_qualifier({"Celtic"}) .. "\n")
table.insert(ret, "* " .. link(c) .. " " .. m_q.format_qualifier({"Celtic"}) .. "\n")
end
end

Navigation menu