Module:mg-spel: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
local PAGENAME = mw.title.getCurrentTitle().text
local PAGENAME = mw.title.getCurrentTitle().text
local gsub = mw.ustring.gsub
local gsub = mw.ustring.gsub
local match = mw.ustring.match


local lang = require("Module:languages").getByCode("cel-gal")
local lang = require("Module:languages").getByCode("cel-gal")
Line 15: Line 16:
local e = term; local a = term; local c = term; local s = term
local e = term; local a = term; local c = term; local s = term
local lh = match(s, "lh")
-- Spanish
-- Spanish
Line 45: Line 47:
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, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier(qs) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang}) .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang})
  .. (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")
Line 59: Line 63:
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. m_q.format_qualifier({"Spanish"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = e, lang = lang}) .. " " .. 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, "* " .. m_l.full_link({term = a, lang = lang}) .. " " .. m_q.format_qualifier({"Asturian"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang}) .. " " .. m_q.format_qualifier({"Southern"}) .. "\n")
table.insert(ret, "* " .. m_l.full_link({term = s, lang = lang})
  .. (lh and ", " .. m_l.full_link({term = s:gsub("lh", "j"), lang = lang}) or " ")
  .. m_q.format_qualifier({"Southern"}) .. "\n")
end
end