diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-11 00:16:10 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-11 00:16:10 -0400 |
commit | 86a477d310c63edf7e9cc0547ef26e544ade1817 (patch) | |
tree | a19c745f331477bebd5b4ee530d01aca34c82697 /src | |
parent | eda6ddbdc6c597916ba533c98ad51a97b42c0d1f (diff) | |
download | SMAPI-86a477d310c63edf7e9cc0547ef26e544ade1817.tar.gz SMAPI-86a477d310c63edf7e9cc0547ef26e544ade1817.tar.bz2 SMAPI-86a477d310c63edf7e9cc0547ef26e544ade1817.zip |
fix content cache always missed when not playing in English
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Framework/SContentManager.cs | 15 |
1 files changed, 10 insertions, 5 deletions
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; } /**** |