Module:Pagetype: Difference between revisions
m
1 revision imported
(Bug fixes - make page object detection respect defaultns with redirects, and fix mappings table handling after switch to mw.loadData. Also, move config data to Module:Pagetype/config, plus beautification tweaks.) |
Vivaporius (talk | contribs) m (1 revision imported) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 195:
function p._main(args)
local redirect = detectRedirects(args)
local pagetype = ""
if redirect then
else
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
|