Module:Nomenclature

local p = {} local cargo = mw.ext.cargo local translation = require('Module:Translation')

--Create an empty table with headers function p.CreateTable --Table structure local resultTable = mw.html.create("table") :addClass("wikitable") :css{ ["margin"] = "1em", ["font-size"] = "95%", }:done --Global header local headerRow = mw.html.create("tr"):done local headerContent = mw.html.create("th") :wikitext(" Names in Other Regions ") :attr("colspan", "4") :css{ ["font-size"] = "110%", }:done headerRow:node(headerContent) resultTable:node(headerRow) --Individual headers --Language headerRow = mw.html.create("tr"):done headerContent = mw.html.create("th") :wikitext("Language") :attr("colspan", "2"):done headerRow:node(headerContent) --Name headerContent = mw.html.create("th") :wikitext("Name"):done headerRow:node(headerContent) --Meaning headerContent = mw.html.create("th") :wikitext("Name"):done headerRow:node(headerContent) resultTable:node(headerRow) return resultTable end

function p.CreateRows(translationTable, term) local resultTranslations = translation.fetchTranslations(term) local resultTranslationsTrimmed = p.TrimTranslations(resultTranslations) local test = "" for key, value in pairs(resultTranslationsTrimmed) do test = test .. "  " .. value["language"] .. "=" .. value["translation"] end return test end

--Removes entries with same language and translation (different games) function p.TrimTranslations(translations) return translations end

function p.Main( frame ) local args = frame:getParent.args local resultTable = p.CreateTable local resultTable = p.CreateRows(resultTable, "Dynalfos") return resultTable end

return p