Module:LangVars

From Vintage Story Wiki
Revision as of 02:50, 23 August 2022 by Sana (talk | contribs)

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

local p = {}

local langVars = {}
function p.processLang(code)
	langVars = require( 'Module:LangVars/' .. code ).i18n
	return langVars
end

function p.link(str)
	local out = str
	local img = str
	
	--Pickaxe head
	if string.lower(str):find(string.lower(langVars.itemPickaxeHead)) then 
		out = langVars.itemPickaxeHead 
		img = 'Iron pickaxe head' 
	end
	--Metal plates
	if string.lower(str):find(string.lower(langVars.itemMetalPlate)) then 
		out = langVars.itemMetalPlate 
		img = 'Iron metal plate' 
	end
	
	return out, img
end

return p