Add basic language switching ability

This commit is contained in:
Dean Herbert
2021-04-20 17:06:01 +09:00
parent e227c076e5
commit 623eae1576
3 changed files with 82 additions and 0 deletions

View File

@ -51,6 +51,7 @@ using osu.Game.Utils;
using LogLevel = osu.Framework.Logging.LogLevel;
using osu.Game.Database;
using osu.Game.IO;
using osu.Game.Localisation;
namespace osu.Game
{
@ -541,6 +542,12 @@ namespace osu.Game
{
base.LoadComplete();
foreach (var language in Enum.GetValues(typeof(Language)).OfType<Language>())
{
var cultureCode = language.ToString();
Localisation.AddLanguage(cultureCode, new ResourceManagerLocalisationStore(cultureCode));
}
// 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