Module:lnk-pro-morph: Difference between revisions
Jump to navigation
Jump to search
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary Tag: Reverted |
||
Line 37: | Line 37: | ||
end | end | ||
return "*" .. table.concat(display) | return "<nowiki>*</nowiki>" .. table.concat(display) | ||
end | end | ||
return export | return export |
Revision as of 19:08, 29 May 2024
local export = {}
local getArgs = require("Module:Arguments").getArgs
local data = mw.loadData("Module:lnk-pro-morph/data")
local m_links = require("Module:links")
local m_languages = require("Module:languages")
local function get_form(form)
local replace = ""
-- processes arguments of the form -Vn:o
if mw.ustring.find(form, "[^%:]%:[^%:]") then
replace = mw.ustring.match(form, "[^%:]+$")
form = mw.ustring.match(form, "^[^%:]+")
end
if not data[form] then return form end
local link = data[form]
if replace ~= "" then form = mw.ustring.gsub(form, "[CV]", replace) end
return m_links.full_link{
term = link,
alt = form,
language = m_languages.get_by_code("lnk-pro"),
nostar = true,
}
end
function export.show(frame)
local args = getArgs(frame)
local display = {}
for _, arg in ipairs(args) do
table.insert(display, get_form(arg))
end
return "<nowiki>*</nowiki>" .. table.concat(display)
end
return export