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

мНет описания правки
мНет описания правки
Строка 1: Строка 1:
local p = {}
local p = {}


if not _G.__call_counter then
function p.increment(frame)
     _G.__call_counter = 0
     local count = mw.getContentLanguage():getContentLanguage():getCode()
end


function p.increment(frame)
    local current_count = mw.getCache():get("call_counter_" .. count) or 0
     _G.__call_counter = _G.__call_counter + 1
 
     return "Модуль вызван " .. _G.__call_counter .. " раз(а) на этой странице."
     current_count = current_count + 1
 
    mw.getCache():set("call_counter_" .. count, current_count)
 
     return "Модуль вызван " .. current_count .. " раз(а) на этой странице."
end
end


return p
return p