Module:Case: Difference between revisions

From Heroes 3 wiki
Jump to navigation Jump to search
(try again)
No edit summary
Line 1: Line 1:
local p = {} --p stands for package
local p = {} --p stands for package


function p.lowercase(frame)
langObject = mw.getLanguage( 'simple' )
     return "[[" .. frame.args.link .. "|" .. string.lower(frame.args.link) .. "]]"
 
function p.title_case(frame)
     return "[[" .. frame.args.link .. "|" .. langObject:uc(frame.args.link) .. "]]"
end
end
langObject = mw.getLanguage( 'simple' )


function p.uppercase_first_letter(frame)
function p.uppercase_first_letter(frame)
     return "[[" .. frame.args.link .. "|" .. langObject:ucfirst(string.lower(frame.args.link)) .. "]]"
     return "[[" .. frame.args.link .. "|" .. langObject:ucfirst(string.lower(frame.args.link)) .. "]]"
end
function p.lowercase(frame)
    return "[[" .. frame.args.link .. "|" .. string.lower(frame.args.link) .. "]]"
end
end


return p
return p

Revision as of 21:39, 22 May 2021

See usage on TEMPLATE:T, Template:u, and template:l.


local p = {} --p stands for package

langObject = mw.getLanguage( 'simple' )

function p.title_case(frame)
    return "[[" .. frame.args.link .. "|" .. langObject:uc(frame.args.link) .. "]]"
end

function p.uppercase_first_letter(frame)
    return "[[" .. frame.args.link .. "|" .. langObject:ucfirst(string.lower(frame.args.link)) .. "]]"
end

function p.lowercase(frame)
    return "[[" .. frame.args.link .. "|" .. string.lower(frame.args.link) .. "]]"
end

return p