模块:Lang

ChthollyRoot(讨论 | 贡献)2020年3月23日 (一) 16:28的版本 (创建页面,内容为“local p = {} function p.quote(text, lang) if lang == 'zh' then return text else return '-{' .. text .. '}-' end end function p.wrap(text, lang) local spa…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

可在模块:Lang/doc创建此模块的帮助文档

local p = {}
 
function p.quote(text, lang)
	if lang == 'zh' then
		return text
	else
		return '-{' .. text .. '}-'
	end
end
 
function p.wrap(text, lang)
	local span = mw.html.create('span')
		:attr('lang', lang)
		:wikitext(p.quote(text, lang))
	return span
end
 
return p