Skip to content

Commit

Permalink
Merge pull request #30965 from Susko3/use-GetLocalisedString
Browse files Browse the repository at this point in the history
Use `LocalisationManager.GetLocalisedString()` instead of bindable hack
  • Loading branch information
peppy authored Dec 5, 2024
2 parents aa0ee5c + 837744b commit 72aa652
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 72aa652

Please sign in to comment.