Skip to content

Commit

Permalink
Use LocalisationManager.GetLocalisedString() instead of bindable hack
Browse files Browse the repository at this point in the history
Made possible by ppy/osu-framework#6377.
  • Loading branch information
Susko3 committed Dec 3, 2024
1 parent f09d8f0 commit 837744b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions osu.Desktop/Windows/WindowsAssociationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,7 @@ private static void updateDescriptions(LocalisationManager? localisation)
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
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Overlays/Settings/Sections/Input/TabletSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ private void load(OsuColour colours, LocalisationManager localisation)
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);
}
}),
Expand Down

0 comments on commit 837744b

Please sign in to comment.