From 19272bc3e8c18b04e5bf13d4e576a7184bbe9f89 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Mon, 27 Jul 2026 21:14:26 +0200 Subject: [PATCH] fix(es_extended/locale): return a single value from TranslateCap TranslateCap returned the result of gsub directly, and gsub returns the string plus the number of substitutions. Whenever TranslateCap is the last argument of a call, that count is passed along as an extra argument. The common case is showNotification(msg, notifyType, ...), which is called with just the message in about 49 places in the core. Those all pass notifyType = 1 instead of nil, so the notification is rendered with a numeric type rather than the intended default. 71 call sites in total have TranslateCap in trailing position. Wrapping the call in parentheses truncates it to one value. The string itself is unchanged, and nothing reads the second value. --- [core]/es_extended/locale.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/locale.lua b/[core]/es_extended/locale.lua index 3f059b62..f721f1b9 100644 --- a/[core]/es_extended/locale.lua +++ b/[core]/es_extended/locale.lua @@ -33,7 +33,7 @@ function Translate(str, ...) -- Translate string end function TranslateCap(str, ...) -- Translate string first char uppercase - return _(str, ...):gsub("^%l", string.upper) + return (_(str, ...):gsub("^%l", string.upper)) end _ = Translate