Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[ create · purge ]
This documentation is transcluded from Module:Int/doc.
-- This is a helper module for [[Template:Int]]

local trim = mw.text.trim
local isValidCode = mw.language.isValidCode
local messageNew = mw.message.new

local frameCurrent = mw.getCurrentFrame()
local preprocess = frameCurrent.preprocess
local pageLang = preprocess(frameCurrent, '{{PAGELANGUAGE}}')

local export = {}

function export.renderIntMessage(frame)
	local args = frame.args
	local msgId = trim(args[1])
	local pargs = (frame:getParent() or {}).args
	local msgArgs = {}
	for k, v in pairs(pargs) do
		local n = tonumber(k) or 0
		if n >= 2 then
			msgArgs[n - 1] = trim(v)
		end
	end
	local lang = args.lang
	if not lang or lang == '' or not isValidCode(lang) then
		lang = pageLang
	end
	local msg = messageNew(msgId, msgArgs):inLanguage(lang)
	if lang == 'qqx' or msg:exists() then
			return msg:isDisabled() and (args.missing or '') or preprocess(frameCurrent, msg:plain())
	else
		return args.missing ~= '' and args.missing or '⧼' .. msgId .. '⧽'
	end
end

return export
Cookies help us deliver our services. By using our services, you agree to our use of cookies.