Skip to content

Commit 38e7aa2

Browse files
committed
fix: add missing tostring() call
1 parent eacc3d8 commit 38e7aa2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

script/locale-loader.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@ local function mergeKey(key, k)
22
if not key then
33
return k
44
end
5-
if k:sub(1, 1):match '%w' then
6-
return key .. '.' .. k
5+
k = tostring(k)
6+
if k:sub(1, 1):match("%w") then
7+
return key .. "." .. k
78
else
89
return key .. k
910
end
1011
end
1112

1213
local function proxy(results, key)
1314
return setmetatable({}, {
14-
__index = function (_, k)
15+
__index = function(_, k)
1516
return proxy(results, mergeKey(key, k))
1617
end,
17-
__newindex = function (_, k, v)
18+
__newindex = function(_, k, v)
1819
results[mergeKey(key, k)] = v
19-
end
20+
end,
2021
})
2122
end
2223

23-
return function (text, path, results)
24+
return function(text, path, results)
2425
results = results or {}
25-
assert(load(text, '@' .. path, "t", proxy(results)))()
26+
assert(load(text, "@" .. path, "t", proxy(results)))()
2627
return results
2728
end

0 commit comments

Comments
 (0)