Module:head/templates: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Tag: Manual revert
 
(31 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 44: Line 45:
local function get_data(args)
local function get_data(args)
local p = m_parameters.process(args, params)
local p = m_parameters.process(args, params)
local language = m_languages.get_by_code(p[1])
local term = mw.title.getCurrentTitle().text
if language.proto then
term = mw.ustring.gsub(term, "^[^/]+/", "")
end
return {
return {
term = args["head"] or mw.title.getCurrentTitle().text,
term = term,
language = m_languages.get_by_code(p[1]),
language = language,
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]),
}
}