fix: locale C or en_US has its own plural manipulation, the default one (#15375)

This commit is contained in:
picospuch authored and GitHub committed 2026-07-08 19:13:36 +02:00
1 parent 96e9e1e9cd
commit b2a9eb0a1b
1 file changed
+4 -1
+4 -1
View File
@@ -166,7 +166,10 @@ function GetText_mt.__index.changeLang(new_lang)
-- the "C" locale disables localization altogether
-- can be various things such as `en_US` or `en_US:en`
if new_lang == "C" or new_lang == nil or new_lang == ""
or new_lang:match("^en_US") == "en_US" then return end
or new_lang:match("^en_US") == "en_US" then
GetText.getPlural = getDefaultPlural
return
end
-- strip encoding suffix in locale like "zh_CN.utf8"
new_lang = new_lang:sub(1, new_lang:find(".%."))