Модуль:Песочница/Pok: различия между версиями

Нет описания правки
Нет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 12: Строка 12:
     if not s then return s end
     if not s then return s end
     return (s:gsub("^%s*(.-)%s*$", "%1"))
     return (s:gsub("^%s*(.-)%s*$", "%1"))
end
local function ucfirst(s)
    if not s or s == "" then return s end
    return mw.ustring.upper(mw.ustring.sub(s, 1, 1)) .. mw.ustring.sub(s, 2)
end
end


Строка 45: Строка 50:
     end
     end
     return content
     return content
end
local function lcfirst(s)
    if not s or s == "" then return s end
    return string.lower(s:sub(1, 1)) .. (s:sub(2) or "")
end
end


Строка 926: Строка 926:


     local function processEntity(kind, name, isStore)
     local function processEntity(kind, name, isStore)
         local pathName = lcfirst(name)
         local pathName = ucfirst(name)
         local tplPath = kind .. "/" .. pathName
         local tplPath = kind .. "/" .. pathName
         if isStore then
         if isStore then