From a8b9f8cde5bafcecd6dfaeb7a8def7823573c514 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 1 Feb 2023 03:20:04 +1100 Subject: [PATCH] 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 '%'. --- imports/locale/shared.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imports/locale/shared.lua b/imports/locale/shared.lua index b0a3811..a61e25e 100644 --- a/imports/locale/shared.lua +++ b/imports/locale/shared.lua @@ -31,7 +31,8 @@ function lib.loadLocale() local locale = locales[var:sub(3, -2)] if locale then - v = v:gsub(var, locale:gsub('%%', '%%%%')) + locale = locale:gsub('%%', '%%%%') + v = v:gsub(var, locale) end end end