1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:52:54 +08:00

Merge pull request #30965 from Susko3/use-GetLocalisedString

Use `LocalisationManager.GetLocalisedString()` instead of bindable hack
This commit is contained in:
Dean Herbert 2024-12-04 23:34:32 -08:00 committed by GitHub
commit 72aa65206d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 11 deletions

View File

@ -148,15 +148,7 @@ namespace osu.Desktop.Windows
foreach (var association in uri_associations)
association.UpdateDescription(getLocalisedString(association.Description));
string getLocalisedString(LocalisableString s)
{
if (localisation == null)
return s.ToString();
var b = localisation.GetLocalisedBindableString(s);
b.UnbindAll();
return b.Value;
}
string getLocalisedString(LocalisableString s) => localisation?.GetLocalisedString(s) ?? s.ToString();
}
#region Native interop

View File

@ -114,10 +114,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows || RuntimeInfo.OS == RuntimeInfo.Platform.Linux)
{
t.NewLine();
var formattedSource = MessageFormatter.FormatText(localisation.GetLocalisedBindableString(TabletSettingsStrings.NoTabletDetectedDescription(
var formattedSource = MessageFormatter.FormatText(localisation.GetLocalisedString(TabletSettingsStrings.NoTabletDetectedDescription(
RuntimeInfo.OS == RuntimeInfo.Platform.Windows
? @"https://opentabletdriver.net/Wiki/FAQ/Windows"
: @"https://opentabletdriver.net/Wiki/FAQ/Linux")).Value);
: @"https://opentabletdriver.net/Wiki/FAQ/Linux")));
t.AddLinks(formattedSource.Text, formattedSource.Links);
}
}),