Module:TNT

From Arden Wiki
Revision as of 01:26, 22 September 2025 by Fetoid (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:TNT/doc

-- Minimal TNT stub for wikis without JsonConfig/Commons
local p = {}

local function render(msg, params)
  local args = params or {}
  -- Keep MediaWiki-style parameter substitution
  return mw.message.newRawMessage(msg or '', table.unpack(args)):plain()
end

function p.msg(frame)
  local a = frame and frame.args or {}
  local key = a[2] or a.key or ''
  local params = {}
  for i = 3, #a do params[#params+1] = a[i] end
  return render(key, params)
end

function p.format(dataset, key, ...)
  return render(key, {...})
end

function p.formatInLanguage(lang, dataset, key, ...)
  return render(key, {...})
end

function p.link(frame)
  local a = frame and frame.args or {}
  return 'c:Data:' .. (a[1] or '')
end

function p.doc(frame)
  return '' -- no templatedata without JsonConfig
end

function p.getTemplateData(dataset)
  return '{}' -- empty JSON to satisfy callers
end

return p