Clear LC_* env vars when running LANG tests (#5568)

In the event that LC_ALL was set, for example, the tests would fail as
it takes precedence over LANG.

Tiny change that prevents language tests from failing if LC_ALL is set
(I also added LC_MESSAGES but I am not sure if that's also needed, from
what I read it also takes precedence) so I did not open an issue prior,
hopefully that's ok!
This commit is contained in:
Stefan Haller 2026-05-01 08:16:22 +02:00 committed by GitHub
commit 8bc329a5a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,6 +104,8 @@ func TestNewTranslationSetFromConfig(t *testing.T) {
for _, s := range scenarios {
t.Run(s.name, func(t *testing.T) {
log := newDummyLog()
t.Setenv("LC_ALL", "")
t.Setenv("LC_MESSAGES", "")
t.Setenv("LANG", s.envLanguage)
actualTranslationSet, err := NewTranslationSetFromConfig(log, s.configLanguage)
if s.expectedErr {