I found part of the problem, which is a display bug rather than a table function bug. On
line 368 of Core-Mainline.lua I localize a table's keys but do not check for value type.
That means keys with nil values are being localized, which shouldn't happen, which means the output table included nil values for keys.
I am about to try this new version, renamed to reflect what the function does. From there, I will continue testing the table functions SDPhantom linked.
Old version because line number change:
Lua Code:
-- translate input table and return localizations
function addon:TranslateTable(inputTable)
-- check inputTable for validity
if not inputTable or type(inputTable) ~= "table" then
error(":TranslateTable, 'inputTable' table expected, got %s", 2):format(type(inputTable))
end
local outputTable = {}
for index in pairs(inputTable) do
outputTable[index] = L[index]
end
return outputTable
end
New version:
Lua Code:
-- translate input table and return localizations for keys
function addon:LocalizeTableKeys(inputTable)
-- check inputTable for validity
if not inputTable or type(inputTable) ~= "table" then
error(("'inputTable' table expected, got type '%s'"):format(type(inputTable)), 2)
end
local outputTable = {}
for key, value in pairs(inputTable) do
if type(value) ~= "string" or type(value) ~= "boolean" or type(value) ~= "nil" then
error(("Expected string, boolean, or nil for 'value' in key '%s', got type '%s'"):format(key, type(value)), 2)
end
if value ~= nil then
outputTable[key] = L[key]
end
end
return outputTable
end