Merge pull request #3056 from sgkoishi/pr3056

Automatic language detection
This commit is contained in:
Lucas Nicodemus 2025-01-26 16:16:58 +09:00 committed by GitHub
commit f71f3b865c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,6 +60,12 @@ namespace TShockAPI
}
}
if (LanguageManager.Instance.ActiveCulture == GameCulture.DefaultCulture)
{
var bf = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static;
// LanguageManager.SetLanguage will change this so we need to reset it back to null
typeof(CultureInfo).GetField("s_currentThreadUICulture", bf)?.SetValue(null, null);
}
return CultureInfo.CurrentUICulture;
}
}