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.
This commit is contained in:
Selt
2026-07-27 21:14:26 +02:00
parent 5354e278de
commit 19272bc3e8
+1 -1
View File
@@ -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