Merge pull request #913 from Blizzard/fix-translate
Fix subtle bug in table.translate
This commit is contained in:
commit
798b72b7d4
@ -401,12 +401,12 @@
|
|||||||
if not translation then return {} end
|
if not translation then return {} end
|
||||||
|
|
||||||
local result = {}
|
local result = {}
|
||||||
for _, value in ipairs(arr) do
|
for i = 1, #arr do
|
||||||
local tvalue
|
local tvalue
|
||||||
if type(translation) == "function" then
|
if type(translation) == "function" then
|
||||||
tvalue = translation(value)
|
tvalue = translation(arr[i])
|
||||||
else
|
else
|
||||||
tvalue = translation[value]
|
tvalue = translation[arr[i]]
|
||||||
end
|
end
|
||||||
if (tvalue) then
|
if (tvalue) then
|
||||||
table.insert(result, tvalue)
|
table.insert(result, tvalue)
|
||||||
|
Loading…
Reference in New Issue
Block a user