From 86a477d310c63edf7e9cc0547ef26e544ade1817 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 11 May 2018 00:16:10 -0400 Subject: fix content cache always missed when not playing in English --- src/SMAPI/Framework/SContentManager.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Framework/SContentManager.cs b/src/SMAPI/Framework/SContentManager.cs index e9f46acb..9353ee29 100644 --- a/src/SMAPI/Framework/SContentManager.cs +++ b/src/SMAPI/Framework/SContentManager.cs @@ -393,11 +393,16 @@ namespace StardewModdingAPI.Framework return this.Cache.ContainsKey(normalisedAssetName); // translated - if (!this.IsLocalisableLookup.TryGetValue(normalisedAssetName, out bool localisable)) - return false; - return localisable - ? this.Cache.ContainsKey($"{normalisedAssetName}.{this.GetLocale(this.GetCurrentLanguage())}") - : this.Cache.ContainsKey(normalisedAssetName); + string localeKey = $"{normalisedAssetName}.{this.GetLocale(this.GetCurrentLanguage())}"; + if (this.IsLocalisableLookup.TryGetValue(localeKey, out bool localisable)) + { + return localisable + ? this.Cache.ContainsKey(localeKey) + : this.Cache.ContainsKey(normalisedAssetName); + } + + // not loaded yet + return false; } /**** -- cgit