Anonymer Benutzer
Modul:Transclusion count: Unterschied zwischen den Versionen
Modul:Transclusion count (Quelltext anzeigen)
Version vom 7. August 2024, 09:32 Uhr
, 7. August 2024Copyedit. (Spelling)
K (1 Version importiert) |
Modul>Rich Farmbrough (Copyedit. (Spelling)) |
||
| Zeile 5: | Zeile 5: | ||
local return_value = nil | local return_value = nil | ||
-- Use demo parameter if it exists, | -- Use demo parameter if it exists, otherwise use current template name | ||
local namespace = mw.title.getCurrentTitle().namespace | local namespace = mw.title.getCurrentTitle().namespace | ||
if frame.args["demo"] and frame.args["demo"] ~= "" then | if frame.args["demo"] and frame.args["demo"] ~= "" then | ||
| Zeile 22: | Zeile 22: | ||
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end | template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end | ||
local index = mw.ustring.sub(mw.title.new(template).text,1,1) | local index = mw.ustring.sub(mw.title.new(template).text,1,1) | ||
local status, data = pcall(function () | local status, data = pcall(function () | ||
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other"))) | return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other"))) | ||
end) | end) | ||
if status then | if status then | ||