mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user