Merge pull request #913 from Blizzard/fix-translate

Fix subtle bug in table.translate
This commit is contained in:
Samuel Surtees 2017-10-10 23:33:35 +10:00 committed by GitHub
commit 798b72b7d4

View File

@ -401,12 +401,12 @@
if not translation then return {} end
local result = {}
for _, value in ipairs(arr) do
for i = 1, #arr do
local tvalue
if type(translation) == "function" then
tvalue = translation(value)
tvalue = translation(arr[i])
else
tvalue = translation[value]
tvalue = translation[arr[i]]
end
if (tvalue) then
table.insert(result, tvalue)