Module:Pagetype: Difference between revisions

add caps parameter per talk request
m (1 revision imported)
(add caps parameter per talk request)
Line 195:
function p._main(args)
local redirect = detectRedirects(args)
local pagetype = ""
if redirect then
returnpagetype = redirect
else
returnpagetype = getNsDetectValue(args)
end
if yesno(args.plural, false) then
if cfg.irregularPlurals[pagetype] then
pagetype = cfg.irregularPlurals[pagetype]
else
pagetype = pagetype .. cfg.plural -- often 's'
end
end
if yesno(args.caps, false) then
pagetype = mw.ustring.upper(mw.ustring.sub(pagetype, 1, 1)) ..
mw.ustring.sub(pagetype, 2)
end
return pagetype
end
 
Anonymous user