diff --git a/osu.Game.Tournament/osu.Game.Tournament.csproj b/osu.Game.Tournament/osu.Game.Tournament.csproj index c8578ac464..2fa7143216 100644 --- a/osu.Game.Tournament/osu.Game.Tournament.csproj +++ b/osu.Game.Tournament/osu.Game.Tournament.csproj @@ -10,5 +10,9 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 150d084a78..caf2a6279a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -36,7 +36,6 @@ using osu.Game.Beatmaps; using osu.Game.Collections; using osu.Game.Configuration; using osu.Game.Database; -using osu.Game.Extensions; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -1053,30 +1052,6 @@ namespace osu.Game { base.LoadComplete(); - var languages = Enum.GetValues(); - - var mappings = languages.Select(language => - { -#if DEBUG - if (language == Language.debug) - return new LocaleMapping("debug", new DebugLocalisationStore()); -#endif - - string cultureCode = language.ToCultureCode(); - - try - { - return new LocaleMapping(new ResourceManagerLocalisationStore(cultureCode)); - } - catch (Exception ex) - { - Logger.Error(ex, $"Could not load localisations for language \"{cultureCode}\""); - return null; - } - }).Where(m => m != null); - - Localisation.AddLocaleMappings(mappings); - // The next time this is updated is in UpdateAfterChildren, which occurs too late and results // in the cursor being shown for a few frames during the intro. // This prevents the cursor from showing until we have a screen with CursorVisible = true diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index e957753c8b..a31dd24352 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -306,6 +306,7 @@ namespace osu.Game MessageFormatter.WebsiteRootUrl = endpoints.WebsiteUrl; + // Initialise localisation frameworkLocale = frameworkConfig.GetBindable(FrameworkSetting.Locale); frameworkLocale.BindValueChanged(_ => updateLanguage()); @@ -501,6 +502,33 @@ namespace osu.Game Fonts.AddStore(new OsuIcon.OsuIconStore(Textures)); } + protected override void LoadComplete() + { + base.LoadComplete(); + + var localeMappings = Enum.GetValues().Select(language => + { +#if DEBUG + if (language == Language.debug) + return new LocaleMapping("debug", new DebugLocalisationStore()); +#endif + + string cultureCode = language.ToCultureCode(); + + try + { + return new LocaleMapping(new ResourceManagerLocalisationStore(cultureCode)); + } + catch (Exception ex) + { + Logger.Error(ex, $"Could not load localisations for language \"{cultureCode}\""); + return null; + } + }).Where(m => m != null); + + Localisation.AddLocaleMappings(localeMappings); + } + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(base.CreateChildDependencies(parent));