Confirmedusers, Interface administrators
1,131
edits
mNo edit summary |
mNo edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local langVars = {} | |||
function p.processLang(code) | function p.processLang(code) | ||
langVars = require( 'Module:LangVars/' .. code ).i18n | |||
return langVars | return langVars | ||
end | |||
function p.link(s) | |||
local str = string.lower(s) | |||
local out, img = s | |||
--Tools and tool heads | |||
for i,v in pairs(langVars.toolTypes) do | |||
if str:match(string.lower(v)) then | |||
out = s | |||
img = 'Iron ' .. str | |||
end | |||
end | |||
--Metal plates | |||
if string.lower(str):find(string.lower(langVars.itemMetalPlate)) then | |||
out = langVars.itemMetalPlate | |||
img = 'Iron plate' | |||
end | |||
--Lanterns | |||
if string.lower(str):find(string.lower(langVars.itemLantern)) then | |||
out = langVars.itemLantern | |||
img = 'Iron lantern' | |||
end | |||
return out, img | |||
end | end | ||
return p | return p |