From 5c8f5624724095c7c98961cb9a857be778aee3c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Apr 2021 14:37:28 +0900 Subject: [PATCH] Don't bail if the underlying localisation resourced is not embedded --- .../Localisation/ResourceManagerLocalisationStore.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Localisation/ResourceManagerLocalisationStore.cs b/osu.Game/Localisation/ResourceManagerLocalisationStore.cs index dd84eff55f..e0f110aba9 100644 --- a/osu.Game/Localisation/ResourceManagerLocalisationStore.cs +++ b/osu.Game/Localisation/ResourceManagerLocalisationStore.cs @@ -34,7 +34,16 @@ public string Get(string lookup) if (!resourceManagers.TryGetValue(ns, out var manager)) resourceManagers[ns] = manager = new ResourceManager(ns, GetType().Assembly); - return manager.GetString(key, EffectiveCulture); + try + { + return manager.GetString(key, EffectiveCulture); + } + catch (MissingManifestResourceException) + { + // in the case the manifest is missing, it is likely that the user is adding code-first implementations of new localisation namespaces. + // it's fine to ignore this as localisation will fallback to default values. + return null; + } } public Task GetAsync(string lookup)