From 241a118becb415c7f1855f1e358e1900bbc77940 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Aug 2019 00:34:13 -0400 Subject: [PATCH] Possible language fix --- src/SMAPI/Framework/SCore.cs | 3 +++ src/SMAPI/Framework/SGame.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 8c77b5e1..991f9914 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -229,6 +229,9 @@ namespace StardewModdingAPI.Framework // add more leniant assembly resolvers AppDomain.CurrentDomain.AssemblyResolve += (sender, e) => AssemblyLoader.ResolveAssembly(e.Name); + // locale event + LocalizedContentManager.OnLanguageChange += locale => this.OnLocaleChanged(); + // override game SGame.ConstructorHack = new SGameConstructorHack(this.Monitor, this.Reflection, this.Toolkit.JsonHelper, this.InitialiseBeforeFirstAssetLoaded); this.GameInstance = new SGame(this.Monitor, this.MonitorForGame, this.Reflection, this.EventManager, this.Toolkit.JsonHelper, this.ModRegistry, SCore.DeprecationManager, this.OnLocaleChanged, this.InitialiseAfterGameStart, this.Dispose); diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 4f5fc671..2941964d 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -529,7 +529,7 @@ namespace StardewModdingAPI.Framework /********* ** Locale changed events *********/ - if (this.Watchers.LocaleWatcher.IsChanged) + if (this.Watchers.LocaleWatcher.IsChanged || SGame.TicksElapsed == 0) { var was = this.Watchers.LocaleWatcher.PreviousValue; var now = this.Watchers.LocaleWatcher.CurrentValue;