Module:Translations: Difference between revisions

From Cassette Beasts
Solari (talk | contribs)
attempt 2??
Solari (talk | contribs)
No edit summary
Line 4: Line 4:


function p.get_tl(frame)
function p.get_tl(frame)
if translations[frame.args[1]][frame.args[2]] ~= nil then
if translations[frame.args[1]] ~= nil then
return translations[frame.args[1]][frame.args[2]]
return translations[frame.args[1]][frame.args[2]]
else
else

Revision as of 21:22, 14 July 2025

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

local p = {}

local translations = mw.text.jsonDecode(mw.title.new('Data:Translations'):getContent())

function p.get_tl(frame)
	if translations[frame.args[1]] ~= nil then
		return translations[frame.args[1]][frame.args[2]]
	else
		return '???'
	end
end

return p