Module:TNT: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
copying from mediawiki. Please allow my bot to do it instead - see mw:WP:TNT. Thanks!
(Updating from mw) |
(copying from mediawiki. Please allow my bot to do it instead - see mw:WP:TNT. Thanks!) |
||
Line 39:
-- Forward declaration of the local functions
local
function p.msg(frame)
Line 75:
function p.doc(frame)
▲ ) .. formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(
▲ dataset = 'Templatedata/' .. mw.text.trim(page)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
Line 124 ⟶ 122:
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end▼
dataset = mw.text.trim(dataset)
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
else
return dataset
end
end
loadData = function(dataset, lang)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
▲ end
▲ if string.sub(dataset,-4) ~= '.tab' then
▲ dataset = dataset .. '.tab'
end
|