Module:head/templates: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Tag: Manual revert
 
(30 intermediate revisions by 2 users not shown)
Line 10: Line 10:
[3] = {list = true},
[3] = {list = true},
["g"] = {list = true},
["g"] = {list = true},
["label"] = {list = true},
["head"] = {},
["head"] = {},
["nocat"] = {type = "boolean"},
["nocat"] = {type = "boolean"},
Line 45: Line 46:
local p = m_parameters.process(args, params)
local p = m_parameters.process(args, params)
local language = m_languages.get_by_code(p[1])
local language = m_languages.get_by_code(p[1])
local term = p["head"] or mw.title.getCurrentTitle().text
local term = mw.title.getCurrentTitle().text
if language.proto then
if language.proto then
local appendix = "Appendix:" .. string.sub(language.name, " ", "_") .. "/"
term = mw.ustring.gsub(term, "^[^/]+/", "")
if string.find(term, appendix) then
term = string.sub(term, #appendix + 1)
end
end
end
return {
return {
Line 57: Line 55:
pos = p[2],
pos = p[2],
genders = p["g"],
genders = p["g"],
head = p["head"],
nocat = p["nocat"],
nocat = p["nocat"],
labels = p["label"],
inflections = get_inflections(p[3]),
inflections = get_inflections(p[3]),
}
}