Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Documentation: Difference between revisions

From The Petit Planet Wiki
No edit summary
Revert auto-category to title case
 
(3 intermediate revisions by the same user not shown)
Line 36: Line 36:
local p = {}
local p = {}
p.i18n = i18n
p.i18n = i18n
-- Capitalizes first letter of strings
-- src: https://stackoverflow.com/questions/2421695/first-character-uppercase-lua
local function firstToUpper(str)
    return (str:gsub("^%l", string.upper))
end


-- --------------------------------------------------------------------------
-- --------------------------------------------------------------------------
Line 136: Line 142:
function p.resolveNamespace(subjectSpace, upperPlural)
function p.resolveNamespace(subjectSpace, upperPlural)
if subjectSpace == 10 then -- Template namespace
if subjectSpace == 10 then -- Template namespace
if upperPlural then return 'templates'
if upperPlural then return 'Templates'
else return 'template' end
else return 'template' end
elseif subjectSpace == 828 then -- Module namespace
elseif subjectSpace == 828 then -- Module namespace
if upperPlural then return 'modules'
if upperPlural then return 'Modules'
else return 'module' end
else return 'module' end
elseif subjectSpace == 6 then -- File namespace
elseif subjectSpace == 6 then -- File namespace
if upperPlural then return 'files'
if upperPlural then return 'Files'
else return 'file' end
else return 'file' end
end
end