1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Merge pull request #13572 from bdach/fix-unsupported-locales

Fix game crashes due to attempting localisation load for unsupported locales
This commit is contained in:
Dean Herbert 2021-06-19 17:09:39 +09:00 committed by GitHub
commit b6e07ff59c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -86,8 +86,10 @@ namespace osu.Game.Localisation
[Description(@"ไทย")]
th,
[Description(@"Tagalog")]
tl,
// Tagalog has no associated localisations yet, and is not supported on Xamarin platforms or Windows versions <10.
// Can be revisited if localisations ever arrive.
//[Description(@"Tagalog")]
//tl,
[Description(@"Türkçe")]
tr,

View File

@ -585,7 +585,15 @@ namespace osu.Game
foreach (var language in Enum.GetValues(typeof(Language)).OfType<Language>())
{
var cultureCode = language.ToCultureCode();
Localisation.AddLanguage(cultureCode, new ResourceManagerLocalisationStore(cultureCode));
try
{
Localisation.AddLanguage(cultureCode, new ResourceManagerLocalisationStore(cultureCode));
}
catch (Exception ex)
{
Logger.Error(ex, $"Could not load localisations for language \"{cultureCode}\"");
}
}
// The next time this is updated is in UpdateAfterChildren, which occurs too late and results