Module:taln-headword: Difference between revisions

Nehster9 (talk | contribs)
m Undo revision 529967 by Nehster9 (talk)
Tag: Undo
Nehster9 (talk | contribs)
mNo edit summary
Line 6: Line 6:
     local title = mw.title.getCurrentTitle().text
     local title = mw.title.getCurrentTitle().text


    local g = args.g or "?"
local g = args.g or "?"
    local rom = args.rom or ""
local rom = args.rom or ""
local pl = args.pl or ""
local plrom = args.plrom or ""


     local pl = args.pl or ""
local gender_map = {
     local plrom = args.plrom or ""
     m = "m.",
    f = "f.",
     n = "n."
}


    local text = "'''" .. title .. "'''"
local text = "'''" .. title .. "'''"


    if rom ~= "" then
if rom ~= "" then
        text = text .. " • (" .. rom .. ")"
    text = text .. " • (" .. rom .. ")"
    end
end


    text = text .. " " .. g
text = text .. " ''" .. (gender_map[g] or (g .. ".")) .. "''"


    if pl ~= "" then
if pl ~= "" then
        text = text .. ", plural '''" .. pl .. "'''"
    text = text .. ", plural '''[[" .. pl .. "]]'''"


        if plrom ~= "" then
    if plrom ~= "" then
            text = text .. " (" .. plrom .. ")"
        text = text .. " (" .. plrom .. ")"
        end
     end
     end
end


     return text
     return text