fix(locale/shared): phrase-construction for strings without placeholders

string.gsub returns two variables, the updated string and the pattern occurrences.
The outer string.gsub would replace n occurrences, or nothing if the string did not
contain '%'.
This commit is contained in:
Linden
2023-02-01 03:20:04 +11:00
parent 8b11d29fb4
commit a8b9f8cde5

View File

@@ -31,7 +31,8 @@ function lib.loadLocale()
local locale = locales[var:sub(3, -2)] local locale = locales[var:sub(3, -2)]
if locale then if locale then
v = v:gsub(var, locale:gsub('%%', '%%%%')) locale = locale:gsub('%%', '%%%%')
v = v:gsub(var, locale)
end end
end end
end end