Module:Nomenclature: Difference between revisions
From Zelda Wiki, the Zelda encyclopedia
update with respect to utilsLanguage
PhantomCaleb (talk | contribs) m (unused import) |
PhantomCaleb (talk | contribs) (update with respect to utilsLanguage) |
||
Line 94: | Line 94: | ||
function h.SortTranslations(translations) | function h.SortTranslations(translations) | ||
local lookupLang = utilsTable.hash(utilsLanguage. | local lookupLang = utilsTable.hash(utilsLanguage.getCodes()) | ||
local lookupGame = utilsTable.hash(utilsGame.GetSortOrder("canon")) | local lookupGame = utilsTable.hash(utilsGame.GetSortOrder("canon")) | ||
table.sort(translations, function (a,b) | table.sort(translations, function (a,b) | ||
Line 108: | Line 108: | ||
function h.ProcessRow(output, cargoData, row, skipMeanings, displayGames) | function h.ProcessRow(output, cargoData, row, skipMeanings, displayGames) | ||
local meanings = h.GetMeanings(cargoData, row) | local meanings = h.GetMeanings(cargoData, row) | ||
local langText, flag = utilsLanguage.printLanguage(row.language) | |||
local tr = output:tag('tr') | local tr = output:tag('tr') | ||
:tag("td") | |||
:addClass("nomenclature-flag") | |||
:wikitext(flag) | |||
:done() | |||
:tag("td") | |||
:wikitext(langText) | |||
:done() | |||
h.PrintNames(tr, cargoData, row, displayGames) | h.PrintNames(tr, cargoData, row, displayGames) | ||
h.MarkRowsToSkip(cargoData, row) | h.MarkRowsToSkip(cargoData, row) | ||
Line 127: | Line 133: | ||
end | end | ||
return ret | return ret | ||
end | end | ||
Line 268: | Line 263: | ||
:node(mw.html.create("th"):wikitext(header)):done() | :node(mw.html.create("th"):wikitext(header)):done() | ||
for key2, language in ipairs(languages) do | for key2, language in ipairs(languages) do | ||
headerRow:node(mw.html.create("th"):wikitext( | local langText, flag = utilsLanguage.printLanguage(language) | ||
headerRow:node( | |||
mw.html.create("th") | |||
:wikitext(flag .. "<br>" .. langText) | |||
:css("width", 100 / (#languages + 1) .. "%") | |||
) | |||
:done() | |||
end | end | ||
Line 305: | Line 306: | ||
-- Formatting tab names | -- Formatting tab names | ||
for key2, language in ipairs(languages) do | for key2, language in ipairs(languages) do | ||
languages[key2] = utilsLanguage. | languages[key2] = utilsLanguage.printLanguage(language, true) | ||
end | end | ||
languages = utilsTable.unique(languages) | |||
tab["tabName"] = table.concat(languages, ", ") | tab["tabName"] = table.concat(languages, ", ") | ||
end | end |