Module:Translations: Difference between revisions

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


function p.example()
function p.example()
return translations['STATUS_WINDOW_NAME']
return translations['STATUS_WINDOW_NAME']['de_DE']
end
end


Line 11: Line 11:
end
end


mw.logObject(p.example())
return p

Revision as of 20:55, 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.example()
	return translations['STATUS_WINDOW_NAME']['de_DE']
end

function p.get_tl(id, lang)
	return translations[id][lang]
end

return p