1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 06:43:02 +08:00

Merge pull request #17899 from Joehuu/localise-most-strings

Use existing web localisation for most hardcoded strings
This commit is contained in:
Dean Herbert 2022-04-21 14:48:12 +09:00 committed by GitHub
commit 5c0e5eb6f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 225 additions and 147 deletions

View File

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Beatmaps namespace osu.Game.Rulesets.Osu.Beatmaps
@ -20,13 +21,13 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
{ {
new BeatmapStatistic new BeatmapStatistic
{ {
Name = @"Circle Count", Name = BeatmapsetsStrings.ShowStatsCountCircles,
Content = circles.ToString(), Content = circles.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles), CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles),
}, },
new BeatmapStatistic new BeatmapStatistic
{ {
Name = @"Slider Count", Name = BeatmapsetsStrings.ShowStatsCountSliders,
Content = sliders.ToString(), Content = sliders.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders), CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders),
}, },

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
@ -55,7 +56,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("no mods selected", () => SelectedMods.Value = Array.Empty<Mod>()); AddStep("no mods selected", () => SelectedMods.Value = Array.Empty<Mod>());
AddAssert("first bar text is Circle Size", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == "Circle Size"); AddAssert("first bar text is correct", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == BeatmapsetsStrings.ShowStatsCs);
AddAssert("circle size bar is white", () => barIsWhite(advancedStats.FirstValue)); AddAssert("circle size bar is white", () => barIsWhite(advancedStats.FirstValue));
AddAssert("HP drain bar is white", () => barIsWhite(advancedStats.HpDrain)); AddAssert("HP drain bar is white", () => barIsWhite(advancedStats.HpDrain));
AddAssert("accuracy bar is white", () => barIsWhite(advancedStats.Accuracy)); AddAssert("accuracy bar is white", () => barIsWhite(advancedStats.Accuracy));
@ -78,7 +79,7 @@ namespace osu.Game.Tests.Visual.SongSelect
StarRating = 8 StarRating = 8
}); });
AddAssert("first bar text is Key Count", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == "Key Count"); AddAssert("first bar text is correct", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == BeatmapsetsStrings.ShowStatsCsMania);
} }
[Test] [Test]

View File

@ -3,6 +3,7 @@
using System; using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation;
namespace osu.Game.Beatmaps namespace osu.Game.Beatmaps
{ {
@ -14,6 +15,6 @@ namespace osu.Game.Beatmaps
public Func<Drawable> CreateIcon; public Func<Drawable> CreateIcon;
public string Content; public string Content;
public string Name; public LocalisableString Name;
} }
} }

View File

@ -12,6 +12,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online; using osu.Game.Online;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Beatmaps.Drawables namespace osu.Game.Beatmaps.Drawables
{ {
@ -104,7 +105,7 @@ namespace osu.Game.Beatmaps.Drawables
if ((beatmapSet as IBeatmapSetOnlineInfo)?.Availability.DownloadDisabled == true) if ((beatmapSet as IBeatmapSetOnlineInfo)?.Availability.DownloadDisabled == true)
{ {
button.Enabled.Value = false; button.Enabled.Value = false;
button.TooltipText = "this beatmap is currently not available for download."; button.TooltipText = BeatmapsetsStrings.AvailabilityDisabled;
} }
break; break;

View File

@ -3,6 +3,7 @@
using System; using System;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -15,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
} }
public OsuMenuItem(string text, MenuItemType type, Action action) public OsuMenuItem(LocalisableString text, MenuItemType type, Action action)
: base(text, action) : base(text, action)
{ {
Type = type; Type = type;

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Graphics.UserInterface.PageSelector namespace osu.Game.Graphics.UserInterface.PageSelector
{ {
@ -29,7 +30,7 @@ namespace osu.Game.Graphics.UserInterface.PageSelector
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Children = new Drawable[] Children = new Drawable[]
{ {
previousPageButton = new PageSelectorPrevNextButton(false, "prev") previousPageButton = new PageSelectorPrevNextButton(false, CommonStrings.PaginationPrevious)
{ {
Action = () => CurrentPage.Value -= 1, Action = () => CurrentPage.Value -= 1,
}, },
@ -38,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface.PageSelector
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
}, },
nextPageButton = new PageSelectorPrevNextButton(true, "next") nextPageButton = new PageSelectorPrevNextButton(true, CommonStrings.PaginationNext)
{ {
Action = () => CurrentPage.Value += 1 Action = () => CurrentPage.Value += 1
} }

View File

@ -2,9 +2,11 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
@ -13,12 +15,12 @@ namespace osu.Game.Graphics.UserInterface.PageSelector
public class PageSelectorPrevNextButton : PageSelectorButton public class PageSelectorPrevNextButton : PageSelectorButton
{ {
private readonly bool rightAligned; private readonly bool rightAligned;
private readonly string text; private readonly LocalisableString text;
private SpriteIcon icon; private SpriteIcon icon;
private OsuSpriteText name; private OsuSpriteText name;
public PageSelectorPrevNextButton(bool rightAligned, string text) public PageSelectorPrevNextButton(bool rightAligned, LocalisableString text)
{ {
this.rightAligned = rightAligned; this.rightAligned = rightAligned;
this.text = text; this.text = text;

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Input; using osuTK.Input;
@ -27,7 +28,7 @@ namespace osu.Game.Graphics.UserInterface
}); });
TextFlow.Padding = new MarginPadding { Right = 35 }; TextFlow.Padding = new MarginPadding { Right = 35 };
PlaceholderText = "type to search"; PlaceholderText = HomeStrings.SearchPlaceholder;
} }
public override bool OnPressed(KeyBindingPressEvent<PlatformAction> e) public override bool OnPressed(KeyBindingPressEvent<PlatformAction> e)

View File

@ -11,7 +11,9 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Overlays; using osu.Game.Overlays;
using osuTK; using osuTK;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -80,7 +82,7 @@ namespace osu.Game.Graphics.UserInterface
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
Text = "show more".ToUpper(), Text = CommonStrings.ButtonsShowMore.ToUpper(),
}, },
rightIcon = new ChevronIcon rightIcon = new ChevronIcon
{ {

View File

@ -14,6 +14,7 @@ using osu.Framework.Localisation;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
namespace osu.Game.Graphics.UserInterfaceV2 namespace osu.Game.Graphics.UserInterfaceV2
@ -139,7 +140,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
public MenuItem[] ContextMenuItems => new MenuItem[] public MenuItem[] ContextMenuItems => new MenuItem[]
{ {
new OsuMenuItem("Delete", MenuItemType.Destructive, () => DeleteRequested?.Invoke()) new OsuMenuItem(CommonStrings.ButtonsDelete, MenuItemType.Destructive, () => DeleteRequested?.Invoke())
}; };
} }
} }

View File

@ -9,16 +9,6 @@ namespace osu.Game.Localisation
{ {
private const string prefix = @"osu.Game.Resources.Localisation.Common"; private const string prefix = @"osu.Game.Resources.Localisation.Common";
/// <summary>
/// "Cancel"
/// </summary>
public static LocalisableString Cancel => new TranslatableString(getKey(@"cancel"), @"Cancel");
/// <summary>
/// "Clear"
/// </summary>
public static LocalisableString Clear => new TranslatableString(getKey(@"clear"), @"Clear");
/// <summary> /// <summary>
/// "Enabled" /// "Enabled"
/// </summary> /// </summary>

View File

@ -1,22 +1,23 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Online.API.Requests.Responses namespace osu.Game.Online.API.Requests.Responses
{ {
public enum APIPlayStyle public enum APIPlayStyle
{ {
[Description("Keyboard")] [LocalisableDescription(typeof(CommonStrings), nameof(CommonStrings.DeviceKeyboard))]
Keyboard, Keyboard,
[Description("Mouse")] [LocalisableDescription(typeof(CommonStrings), nameof(CommonStrings.DeviceMouse))]
Mouse, Mouse,
[Description("Tablet")] [LocalisableDescription(typeof(CommonStrings), nameof(CommonStrings.DeviceTablet))]
Tablet, Tablet,
[Description("Touch Screen")] [LocalisableDescription(typeof(CommonStrings), nameof(CommonStrings.DeviceTouch))]
Touch, Touch,
} }
} }

View File

@ -12,6 +12,7 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Chat; using osu.Game.Overlays.Chat;
using osu.Game.Resources.Localisation.Web;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Online.Chat namespace osu.Game.Online.Chat
@ -63,7 +64,7 @@ namespace osu.Game.Online.Chat
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = text_box_height, Height = text_box_height,
PlaceholderText = "type your message", PlaceholderText = ChatStrings.InputPlaceholder,
CornerRadius = corner_radius, CornerRadius = corner_radius,
ReleaseFocusOnCommit = false, ReleaseFocusOnCommit = false,
HoldFocus = true, HoldFocus = true,

View File

@ -30,6 +30,7 @@ using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Utils; using osu.Game.Utils;
namespace osu.Game.Online.Leaderboards namespace osu.Game.Online.Leaderboards
@ -291,8 +292,8 @@ namespace osu.Game.Online.Leaderboards
protected virtual IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[] protected virtual IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[]
{ {
new LeaderboardScoreStatistic(FontAwesome.Solid.Link, "Max Combo", model.MaxCombo.ToString()), new LeaderboardScoreStatistic(FontAwesome.Solid.Link, BeatmapsetsStrings.ShowScoreboardHeadersCombo, model.MaxCombo.ToString()),
new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, "Accuracy", model.DisplayAccuracy) new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, BeatmapsetsStrings.ShowScoreboardHeadersAccuracy, model.DisplayAccuracy)
}; };
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
@ -403,9 +404,9 @@ namespace osu.Game.Online.Leaderboards
{ {
public IconUsage Icon; public IconUsage Icon;
public LocalisableString Value; public LocalisableString Value;
public string Name; public LocalisableString Name;
public LeaderboardScoreStatistic(IconUsage icon, string name, LocalisableString value) public LeaderboardScoreStatistic(IconUsage icon, LocalisableString name, LocalisableString value)
{ {
Icon = icon; Icon = icon;
Name = name; Name = name;
@ -426,7 +427,7 @@ namespace osu.Game.Online.Leaderboards
items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => new LegacyScoreExporter(storage).Export(Score))); items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => new LegacyScoreExporter(storage).Export(Score)));
if (!isOnlineScope) if (!isOnlineScope)
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score)))); items.Add(new OsuMenuItem(CommonStrings.ButtonsDelete, MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score))));
return items.ToArray(); return items.ToArray();
} }

View File

@ -1,7 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Online.Rooms namespace osu.Game.Online.Rooms
{ {
@ -11,10 +12,10 @@ namespace osu.Game.Online.Rooms
Playlists, Playlists,
[Description("Head to head")] [LocalisableDescription(typeof(MatchesStrings), nameof(MatchesStrings.MatchTeamTypesHeadToHead))]
HeadToHead, HeadToHead,
[Description("Team VS")] [LocalisableDescription(typeof(MatchesStrings), nameof(MatchesStrings.MatchTeamTypesTeamVs))]
TeamVersus, TeamVersus,
} }
} }

View File

@ -16,6 +16,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -68,7 +69,7 @@ namespace osu.Game.Overlays.AccountCreation
}, },
usernameTextBox = new OsuTextBox usernameTextBox = new OsuTextBox
{ {
PlaceholderText = "username", PlaceholderText = UsersStrings.LoginUsername,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
TabbableContentContainer = this TabbableContentContainer = this
}, },

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet namespace osu.Game.Overlays.BeatmapSet
@ -69,14 +70,14 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
textContainer.Clear(); textContainer.Clear();
textContainer.AddParagraph(downloadDisabled textContainer.AddParagraph(downloadDisabled
? "This beatmap is currently not available for download." ? BeatmapsetsStrings.AvailabilityDisabled
: "Portions of this beatmap have been removed at the request of the creator or a third-party rights holder.", t => t.Colour = Color4.Orange); : BeatmapsetsStrings.AvailabilityPartsRemoved, t => t.Colour = Color4.Orange);
if (hasExternalLink) if (hasExternalLink)
{ {
textContainer.NewParagraph(); textContainer.NewParagraph();
textContainer.NewParagraph(); textContainer.NewParagraph();
textContainer.AddLink("Check here for more information.", BeatmapSet.Availability.ExternalLink, creationParameters: t => t.Font = OsuFont.GetFont(size: 10)); textContainer.AddLink(BeatmapsetsStrings.AvailabilityMoreInfo, BeatmapSet.Availability.ExternalLink, creationParameters: t => t.Font = OsuFont.GetFont(size: 10));
} }
} }
} }

View File

@ -7,6 +7,7 @@ using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.BeatmapSet.Scores namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
@ -28,7 +29,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = @"You need to be an osu!supporter to access the friend and country rankings!", Text = BeatmapsetsStrings.ShowScoreboardSupporterOnly,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold),
}, },
text = new LinkFlowContainer(t => t.Font = t.Font.With(size: 11)) text = new LinkFlowContainer(t => t.Font = t.Font.With(size: 11))

View File

@ -160,7 +160,7 @@ namespace osu.Game.Overlays
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Height = 1, Height = 1,
PlaceholderText = "type your message", PlaceholderText = Resources.Localisation.Web.ChatStrings.InputPlaceholder,
ReleaseFocusOnCommit = false, ReleaseFocusOnCommit = false,
HoldFocus = true, HoldFocus = true,
} }

View File

@ -3,6 +3,7 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments.Buttons namespace osu.Game.Overlays.Comments.Buttons
{ {
@ -25,7 +26,7 @@ namespace osu.Game.Overlays.Comments.Buttons
{ {
public ButtonContent() public ButtonContent()
{ {
Text = "load replies"; Text = CommentsStrings.LoadReplies;
} }
} }
} }

View File

@ -9,6 +9,7 @@ using osu.Game.Graphics.Sprites;
using System.Collections.Generic; using System.Collections.Generic;
using osuTK; using osuTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments.Buttons namespace osu.Game.Overlays.Comments.Buttons
{ {
@ -38,7 +39,7 @@ namespace osu.Game.Overlays.Comments.Buttons
{ {
AlwaysPresent = true, AlwaysPresent = true,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
Text = "show more" Text = CommonStrings.ButtonsShowMore
} }
}; };

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
@ -54,7 +55,7 @@ namespace osu.Game.Overlays.Comments
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
Margin = new MarginPadding { Horizontal = 20 }, Margin = new MarginPadding { Horizontal = 20 },
Text = @"Cancel" Text = CommonStrings.ButtonsCancel
} }
} }
}; };

View File

@ -16,6 +16,7 @@ using osu.Framework.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using JetBrains.Annotations; using JetBrains.Annotations;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser; using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
@ -328,7 +329,7 @@ namespace osu.Game.Overlays.Comments
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Margin = new MarginPadding { Left = 50 }, Margin = new MarginPadding { Left = 50 },
Text = @"No comments yet." Text = CommentsStrings.Empty
} }
}); });
} }

View File

@ -12,7 +12,9 @@ using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osuTK; using osuTK;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
@ -91,7 +93,7 @@ namespace osu.Game.Overlays.Comments
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
Text = @"Show deleted" Text = CommonStrings.ButtonsShowDeleted
} }
}, },
}); });
@ -126,9 +128,13 @@ namespace osu.Game.Overlays.Comments
public enum CommentsSortCriteria public enum CommentsSortCriteria
{ {
[System.ComponentModel.Description(@"Recent")] [LocalisableDescription(typeof(SortStrings), nameof(SortStrings.New))]
New, New,
[LocalisableDescription(typeof(SortStrings), nameof(SortStrings.Old))]
Old, Old,
[LocalisableDescription(typeof(SortStrings), nameof(SortStrings.Top))]
Top Top
} }
} }

View File

@ -2,7 +2,10 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
@ -18,7 +21,8 @@ namespace osu.Game.Overlays.Comments
private void onCurrentChanged(ValueChangedEvent<int> count) private void onCurrentChanged(ValueChangedEvent<int> count)
{ {
Text = $@"Show More ({count.NewValue})".ToUpper(); Text = new TranslatableString(@"_", "{0} ({1})",
CommonStrings.ButtonsShowMore.ToUpper(), count.NewValue);
} }
} }
} }

View File

@ -150,7 +150,7 @@ namespace osu.Game.Overlays.Comments
{ {
Alpha = Comment.IsDeleted ? 1 : 0, Alpha = Comment.IsDeleted ? 1 : 0,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold),
Text = "deleted" Text = CommentsStrings.Deleted
} }
} }
}, },

View File

@ -9,6 +9,7 @@ using osuTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
@ -39,7 +40,7 @@ namespace osu.Game.Overlays.Comments
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 20, italics: true), Font = OsuFont.GetFont(size: 20, italics: true),
Colour = colourProvider.Light1, Colour = colourProvider.Light1,
Text = @"Comments" Text = CommentsStrings.Title
}, },
new CircularContainer new CircularContainer
{ {

View File

@ -14,6 +14,7 @@ using osu.Game.Database;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Spectator; using osu.Game.Online.Spectator;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Screens.OnlinePlay.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
@ -138,7 +139,7 @@ namespace osu.Game.Overlays.Dashboard
new PurpleTriangleButton new PurpleTriangleButton
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Watch", Text = "Spectate",
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Action = () => performer?.PerformFromScreen(s => s.Push(new SoloSpectator(User))), Action = () => performer?.PerformFromScreen(s => s.Push(new SoloSpectator(User))),

View File

@ -6,6 +6,7 @@ using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
@ -49,7 +50,7 @@ namespace osu.Game.Overlays.Dashboard.Home
flow.AddRange(beatmapSets.Select(CreateBeatmapPanel)); flow.AddRange(beatmapSets.Select(CreateBeatmapPanel));
} }
protected abstract string Title { get; } protected abstract LocalisableString Title { get; }
protected abstract DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet); protected abstract DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet);
} }

View File

@ -2,7 +2,9 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Localisation;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Dashboard.Home namespace osu.Game.Overlays.Dashboard.Home
{ {
@ -15,6 +17,6 @@ namespace osu.Game.Overlays.Dashboard.Home
protected override DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet) => new DashboardNewBeatmapPanel(beatmapSet); protected override DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet) => new DashboardNewBeatmapPanel(beatmapSet);
protected override string Title => "New Ranked Beatmaps"; protected override LocalisableString Title => HomeStrings.UserBeatmapsNew;
} }
} }

View File

@ -2,7 +2,9 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Localisation;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Dashboard.Home namespace osu.Game.Overlays.Dashboard.Home
{ {
@ -15,6 +17,6 @@ namespace osu.Game.Overlays.Dashboard.Home
protected override DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet) => new DashboardPopularBeatmapPanel(beatmapSet); protected override DashboardBeatmapPanel CreateBeatmapPanel(APIBeatmapSet beatmapSet) => new DashboardPopularBeatmapPanel(beatmapSet);
protected override string Title => "Popular Beatmaps"; protected override LocalisableString Title => HomeStrings.UserBeatmapsPopular;
} }
} }

View File

@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays.Dashboard.Home.News namespace osu.Game.Overlays.Dashboard.Home.News
@ -35,7 +36,7 @@ namespace osu.Game.Overlays.Dashboard.Home.News
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Margin = new MarginPadding { Vertical = 20 }, Margin = new MarginPadding { Vertical = 20 },
Text = "see more" Text = CommonStrings.ButtonsSeeMore
} }
}; };

View File

@ -3,6 +3,7 @@
using System; using System;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Dialog namespace osu.Game.Overlays.Dialog
{ {
@ -33,7 +34,7 @@ namespace osu.Game.Overlays.Dialog
}, },
new PopupDialogCancelButton new PopupDialogCancelButton
{ {
Text = Localisation.CommonStrings.Cancel, Text = CommonStrings.ButtonsCancel,
Action = onCancel Action = onCancel
}, },
}; };

View File

@ -13,6 +13,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
namespace osu.Game.Overlays.Login namespace osu.Game.Overlays.Login
@ -50,14 +51,14 @@ namespace osu.Game.Overlays.Login
{ {
username = new OsuTextBox username = new OsuTextBox
{ {
PlaceholderText = "username", PlaceholderText = UsersStrings.LoginUsername,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = api?.ProvidedUsername ?? string.Empty, Text = api?.ProvidedUsername ?? string.Empty,
TabbableContentContainer = this TabbableContentContainer = this
}, },
password = new OsuPasswordTextBox password = new OsuPasswordTextBox
{ {
PlaceholderText = "password", PlaceholderText = UsersStrings.LoginPassword,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
TabbableContentContainer = this, TabbableContentContainer = this,
}, },
@ -88,7 +89,7 @@ namespace osu.Game.Overlays.Login
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Child = new SettingsButton Child = new SettingsButton
{ {
Text = "Sign in", Text = UsersStrings.LoginButton,
Action = performLogin Action = performLogin
}, },
} }

View File

@ -2,11 +2,14 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using System.ComponentModel;
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Login namespace osu.Game.Overlays.Login
{ {
public enum UserAction public enum UserAction
{ {
[LocalisableDescription(typeof(UsersStrings), nameof(UsersStrings.StatusOnline))]
Online, Online,
[Description(@"Do not disturb")] [Description(@"Do not disturb")]

View File

@ -20,6 +20,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Utils; using osu.Game.Utils;
@ -317,7 +318,7 @@ namespace osu.Game.Overlays.Mods
CloseButton = new TriangleButton CloseButton = new TriangleButton
{ {
Width = 180, Width = 180,
Text = "Close", Text = CommonStrings.ButtonsClose,
Action = Hide, Action = Hide,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,

View File

@ -15,7 +15,8 @@ using osu.Framework.Localisation;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Localisation; using osu.Game.Resources.Localisation.Web;
using NotificationsStrings = osu.Game.Localisation.NotificationsStrings;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
@ -61,7 +62,7 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Children = new[] Children = new[]
{ {
new NotificationSection(@"Notifications", @"Clear All") new NotificationSection(AccountsStrings.NotificationsTitle, "Clear All")
{ {
AcceptTypes = new[] { typeof(SimpleNotification) } AcceptTypes = new[] { typeof(SimpleNotification) }
}, },

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation; using osu.Framework.Localisation;
@ -34,9 +35,9 @@ namespace osu.Game.Overlays.Notifications
private readonly string clearButtonText; private readonly string clearButtonText;
private readonly string titleText; private readonly LocalisableString titleText;
public NotificationSection(string title, string clearButtonText) public NotificationSection(LocalisableString title, string clearButtonText)
{ {
this.clearButtonText = clearButtonText.ToUpperInvariant(); this.clearButtonText = clearButtonText.ToUpperInvariant();
titleText = title; titleText = title;
@ -84,7 +85,7 @@ namespace osu.Game.Overlays.Notifications
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = titleText.ToUpperInvariant(), Text = titleText.ToUpper(),
Font = OsuFont.GetFont(weight: FontWeight.Bold) Font = OsuFont.GetFont(weight: FontWeight.Bold)
}, },
countDrawable = new OsuSpriteText countDrawable = new OsuSpriteText

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Linq;
using Humanizer; using Humanizer;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -11,10 +10,12 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -83,7 +84,7 @@ namespace osu.Game.Overlays.Profile.Header
if (user == null) return; if (user == null) return;
if (user.JoinDate.ToUniversalTime().Year < 2008) if (user.JoinDate.ToUniversalTime().Year < 2008)
topLinkContainer.AddText("Here since the beginning"); topLinkContainer.AddText(UsersStrings.ShowFirstMembers);
else else
{ {
topLinkContainer.AddText("Joined "); topLinkContainer.AddText("Joined ");
@ -94,7 +95,7 @@ namespace osu.Game.Overlays.Profile.Header
if (user.IsOnline) if (user.IsOnline)
{ {
topLinkContainer.AddText("Currently online"); topLinkContainer.AddText(UsersStrings.ShowLastvisitOnline);
addSpacer(topLinkContainer); addSpacer(topLinkContainer);
} }
else if (user.LastVisit.HasValue) else if (user.LastVisit.HasValue)
@ -108,7 +109,16 @@ namespace osu.Game.Overlays.Profile.Header
if (user.PlayStyles?.Length > 0) if (user.PlayStyles?.Length > 0)
{ {
topLinkContainer.AddText("Plays with "); topLinkContainer.AddText("Plays with ");
topLinkContainer.AddText(string.Join(", ", user.PlayStyles.Select(style => style.GetDescription())), embolden);
LocalisableString playStylesString = user.PlayStyles[0].GetLocalisableDescription();
for (int i = 1; i < user.PlayStyles.Length; i++)
{
playStylesString = new TranslatableString(@"_", @"{0}{1}", playStylesString, CommonStrings.ArrayAndWordsConnector);
playStylesString = new TranslatableString(@"_", @"{0}{1}", playStylesString, user.PlayStyles[i].GetLocalisableDescription());
}
topLinkContainer.AddText(playStylesString, embolden);
addSpacer(topLinkContainer); addSpacer(topLinkContainer);
} }

View File

@ -21,7 +21,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input; using osu.Game.Input;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Localisation; using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Input; using osuTK.Input;
@ -402,7 +402,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{ {
public CancelButton() public CancelButton()
{ {
Text = CommonStrings.Cancel; Text = CommonStrings.ButtonsCancel;
Size = new Vector2(80, 20); Size = new Vector2(80, 20);
} }
} }
@ -411,7 +411,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{ {
public ClearButton() public ClearButton()
{ {
Text = CommonStrings.Clear; Text = CommonStrings.ButtonsClear;
Size = new Vector2(80, 20); Size = new Vector2(80, 20);
} }
} }

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Effects;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -62,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar
switch (state.NewValue) switch (state.NewValue)
{ {
default: default:
Text = @"Guest"; Text = UsersStrings.AnonymousUsername;
avatar.User = new APIUser(); avatar.User = new APIUser();
break; break;

View File

@ -7,7 +7,9 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Containers.Markdown; using osu.Framework.Graphics.Containers.Markdown;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Wiki.Markdown namespace osu.Game.Overlays.Wiki.Markdown
{ {
@ -46,14 +48,14 @@ namespace osu.Game.Overlays.Wiki.Markdown
{ {
Add(new NoticeBox Add(new NoticeBox
{ {
Text = "The content on this page is incomplete or outdated. If you are able to help out, please consider updating the article!", Text = WikiStrings.ShowIncompleteOrOutdated,
}); });
} }
else if (needsCleanup) else if (needsCleanup)
{ {
Add(new NoticeBox Add(new NoticeBox
{ {
Text = "This page does not meet the standards of the osu! wiki and needs to be cleaned up or rewritten. If you are able to help out, please consider updating the article!", Text = WikiStrings.ShowNeedsCleanupOrRewrite,
}); });
} }
} }
@ -63,7 +65,7 @@ namespace osu.Game.Overlays.Wiki.Markdown
[Resolved] [Resolved]
private IMarkdownTextFlowComponent parentFlowComponent { get; set; } private IMarkdownTextFlowComponent parentFlowComponent { get; set; }
public string Text { get; set; } public LocalisableString Text { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, OsuColour colour) private void load(OverlayColourProvider colourProvider, OsuColour colour)

View File

@ -3,11 +3,13 @@
using Markdig.Syntax; using Markdig.Syntax;
using Markdig.Syntax.Inlines; using Markdig.Syntax.Inlines;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Containers.Markdown; using osu.Framework.Graphics.Containers.Markdown;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Wiki namespace osu.Game.Overlays.Wiki
{ {
@ -24,7 +26,7 @@ namespace osu.Game.Overlays.Wiki
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = "CONTENTS", Text = WikiStrings.ShowToc.ToUpper(),
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
Margin = new MarginPadding { Bottom = 5 }, Margin = new MarginPadding { Bottom = 5 },
}, },

View File

@ -17,6 +17,7 @@ using osu.Framework.Input.Events;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osuTK; using osuTK;
using osuTK.Input; using osuTK.Input;
@ -358,7 +359,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (SelectedBlueprints.Count == 1) if (SelectedBlueprints.Count == 1)
items.AddRange(SelectedBlueprints[0].ContextMenuItems); items.AddRange(SelectedBlueprints[0].ContextMenuItems);
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, DeleteSelected)); items.Add(new OsuMenuItem(CommonStrings.ButtonsDelete, MenuItemType.Destructive, DeleteSelected));
return items.ToArray(); return items.ToArray();
} }

View File

@ -29,6 +29,7 @@ using osu.Game.Input.Bindings;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Edit.Components;
@ -252,7 +253,7 @@ namespace osu.Game.Screens.Edit
{ {
Items = createFileMenuItems() Items = createFileMenuItems()
}, },
new MenuItem("Edit") new MenuItem(CommonStrings.ButtonsEdit)
{ {
Items = new[] Items = new[]
{ {

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Screens.Edit.Setup namespace osu.Game.Screens.Edit.Setup
{ {
@ -27,7 +28,7 @@ namespace osu.Game.Screens.Edit.Setup
{ {
circleSizeSlider = new LabelledSliderBar<float> circleSizeSlider = new LabelledSliderBar<float>
{ {
Label = "Object Size", Label = BeatmapsetsStrings.ShowStatsCs,
FixedLabelWidth = LABEL_WIDTH, FixedLabelWidth = LABEL_WIDTH,
Description = "The size of all hit objects", Description = "The size of all hit objects",
Current = new BindableFloat(Beatmap.Difficulty.CircleSize) Current = new BindableFloat(Beatmap.Difficulty.CircleSize)
@ -40,7 +41,7 @@ namespace osu.Game.Screens.Edit.Setup
}, },
healthDrainSlider = new LabelledSliderBar<float> healthDrainSlider = new LabelledSliderBar<float>
{ {
Label = "Health Drain", Label = BeatmapsetsStrings.ShowStatsDrain,
FixedLabelWidth = LABEL_WIDTH, FixedLabelWidth = LABEL_WIDTH,
Description = "The rate of passive health drain throughout playable time", Description = "The rate of passive health drain throughout playable time",
Current = new BindableFloat(Beatmap.Difficulty.DrainRate) Current = new BindableFloat(Beatmap.Difficulty.DrainRate)
@ -53,7 +54,7 @@ namespace osu.Game.Screens.Edit.Setup
}, },
approachRateSlider = new LabelledSliderBar<float> approachRateSlider = new LabelledSliderBar<float>
{ {
Label = "Approach Rate", Label = BeatmapsetsStrings.ShowStatsAr,
FixedLabelWidth = LABEL_WIDTH, FixedLabelWidth = LABEL_WIDTH,
Description = "The speed at which objects are presented to the player", Description = "The speed at which objects are presented to the player",
Current = new BindableFloat(Beatmap.Difficulty.ApproachRate) Current = new BindableFloat(Beatmap.Difficulty.ApproachRate)
@ -66,7 +67,7 @@ namespace osu.Game.Screens.Edit.Setup
}, },
overallDifficultySlider = new LabelledSliderBar<float> overallDifficultySlider = new LabelledSliderBar<float>
{ {
Label = "Overall Difficulty", Label = BeatmapsetsStrings.ShowStatsAccuracy,
FixedLabelWidth = LABEL_WIDTH, FixedLabelWidth = LABEL_WIDTH,
Description = "The harshness of hit windows and difficulty of special objects (ie. spinners)", Description = "The harshness of hit windows and difficulty of special objects (ie. spinners)",
Current = new BindableFloat(Beatmap.Difficulty.OverallDifficulty) Current = new BindableFloat(Beatmap.Difficulty.OverallDifficulty)

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Screens.Edit.Setup namespace osu.Game.Screens.Edit.Setup
{ {
@ -48,15 +49,15 @@ namespace osu.Game.Screens.Edit.Setup
creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.Author.Username), creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.Author.Username),
difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.DifficultyName), difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.DifficultyName),
sourceTextBox = createTextBox<LabelledTextBox>("Source", metadata.Source), sourceTextBox = createTextBox<LabelledTextBox>(BeatmapsetsStrings.ShowInfoSource, metadata.Source),
tagsTextBox = createTextBox<LabelledTextBox>("Tags", metadata.Tags) tagsTextBox = createTextBox<LabelledTextBox>(BeatmapsetsStrings.ShowInfoTags, metadata.Tags)
}; };
foreach (var item in Children.OfType<LabelledTextBox>()) foreach (var item in Children.OfType<LabelledTextBox>())
item.OnCommit += onCommit; item.OnCommit += onCommit;
} }
private TTextBox createTextBox<TTextBox>(string label, string initialValue) private TTextBox createTextBox<TTextBox>(LocalisableString label, string initialValue)
where TTextBox : LabelledTextBox, new() where TTextBox : LabelledTextBox, new()
=> new TTextBox => new TTextBox
{ {

View File

@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
@ -34,7 +35,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
private readonly Circle line; private readonly Circle line;
private readonly OsuSpriteText details; private readonly OsuSpriteText details;
public OverlinedHeader(string title) public OverlinedHeader(LocalisableString title)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;

View File

@ -26,6 +26,7 @@ using osu.Game.Online;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Overlays.BeatmapSet; using osu.Game.Overlays.BeatmapSet;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
@ -449,7 +450,7 @@ namespace osu.Game.Screens.OnlinePlay
Size = new Vector2(30, 30), Size = new Vector2(30, 30),
Alpha = AllowEditing ? 1 : 0, Alpha = AllowEditing ? 1 : 0,
Action = () => RequestEdit?.Invoke(Item), Action = () => RequestEdit?.Invoke(Item),
TooltipText = "Edit" TooltipText = CommonStrings.ButtonsEdit
}, },
removeButton = new PlaylistRemoveButton removeButton = new PlaylistRemoveButton
{ {

View File

@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.OnlinePlay.Match.Components namespace osu.Game.Screens.OnlinePlay.Match.Components
@ -30,8 +31,8 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
protected override IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[] protected override IEnumerable<LeaderboardScoreStatistic> GetStatistics(ScoreInfo model) => new[]
{ {
new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, "Accuracy", model.DisplayAccuracy), new LeaderboardScoreStatistic(FontAwesome.Solid.Crosshairs, RankingsStrings.StatAccuracy, model.DisplayAccuracy),
new LeaderboardScoreStatistic(FontAwesome.Solid.Sync, "Total Attempts", score.TotalAttempts.ToString()), new LeaderboardScoreStatistic(FontAwesome.Solid.Sync, RankingsStrings.StatPlayCount, score.TotalAttempts.ToString()),
new LeaderboardScoreStatistic(FontAwesome.Solid.Check, "Completed Beatmaps", score.CompletedBeatmaps.ToString()), new LeaderboardScoreStatistic(FontAwesome.Solid.Check, "Completed Beatmaps", score.CompletedBeatmaps.ToString()),
}; };
} }

View File

@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Drawables;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms; using osu.Game.Online.Rooms;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.OnlinePlay.Lounge.Components; using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.OnlinePlay.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osuTK; using osuTK;
@ -49,7 +50,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
{ {
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Size = new Vector2(100, 1), Size = new Vector2(100, 1),
Text = "Edit", Text = CommonStrings.ButtonsEdit,
Action = () => OnEdit?.Invoke() Action = () => OnEdit?.Invoke()
}); });
} }

View File

@ -3,6 +3,7 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.OnlinePlay.Components; using osu.Game.Screens.OnlinePlay.Components;
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
@ -13,7 +14,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
private MultiplayerClient client { get; set; } private MultiplayerClient client { get; set; }
public ParticipantsListHeader() public ParticipantsListHeader()
: base("Participants") : base(RankingsStrings.SpotlightParticipants)
{ {
} }

View File

@ -14,6 +14,7 @@ using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
using osuTK; using osuTK;
@ -158,7 +159,7 @@ namespace osu.Game.Screens.Play
{ {
new Drawable[] new Drawable[]
{ {
new MetadataLineLabel("Source"), new MetadataLineLabel(BeatmapsetsStrings.ShowInfoSource),
new MetadataLineInfo(metadata.Source) new MetadataLineInfo(metadata.Source)
}, },
new Drawable[] new Drawable[]
@ -213,7 +214,7 @@ namespace osu.Game.Screens.Play
private class MetadataLineLabel : OsuSpriteText private class MetadataLineLabel : OsuSpriteText
{ {
public MetadataLineLabel(string text) public MetadataLineLabel(LocalisableString text)
{ {
Anchor = Anchor.TopRight; Anchor = Anchor.TopRight;
Origin = Anchor.TopRight; Origin = Anchor.TopRight;

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring; using osu.Game.Scoring;
using osuTK; using osuTK;
@ -42,7 +43,7 @@ namespace osu.Game.Screens.Play.Break
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
AccuracyDisplay = new PercentageBreakInfoLine("Accuracy"), AccuracyDisplay = new PercentageBreakInfoLine(BeatmapsetsStrings.ShowStatsAccuracy),
// See https://github.com/ppy/osu/discussions/15185 // See https://github.com/ppy/osu/discussions/15185
// RankDisplay = new BreakInfoLine<int>("Rank"), // RankDisplay = new BreakInfoLine<int>("Rank"),

View File

@ -26,7 +26,7 @@ namespace osu.Game.Screens.Play.Break
private readonly string prefix; private readonly string prefix;
public BreakInfoLine(string name, string prefix = @"") public BreakInfoLine(LocalisableString name, string prefix = @"")
{ {
this.prefix = prefix; this.prefix = prefix;
@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.Break
public class PercentageBreakInfoLine : BreakInfoLine<double> public class PercentageBreakInfoLine : BreakInfoLine<double>
{ {
public PercentageBreakInfoLine(string name, string prefix = "") public PercentageBreakInfoLine(LocalisableString name, string prefix = "")
: base(name, prefix) : base(name, prefix)
{ {
} }

View File

@ -19,6 +19,7 @@ using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
@ -200,7 +201,7 @@ namespace osu.Game.Screens.Play.HUD
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Text = @"pp", Text = BeatmapsetsStrings.ShowScoreboardHeaderspp,
Font = OsuFont.Numeric.With(size: 8), Font = OsuFont.Numeric.With(size: 8),
Padding = new MarginPadding { Bottom = 1.5f }, // align baseline better Padding = new MarginPadding { Bottom = 1.5f }, // align baseline better
} }

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Localisation;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.Play.PlayerSettings namespace osu.Game.Screens.Play.PlayerSettings
@ -20,7 +21,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }, beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapHitsounds },
new BeatmapOffsetControl new BeatmapOffsetControl
{ {
ReferenceScore = { BindTarget = ReferenceScore }, ReferenceScore = { BindTarget = ReferenceScore },

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Localisation;
namespace osu.Game.Screens.Play.PlayerSettings namespace osu.Game.Screens.Play.PlayerSettings
{ {
@ -23,7 +24,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = "Background dim:" Text = GameplaySettingsStrings.BackgroundDim
}, },
dimSliderBar = new PlayerSliderBar<double> dimSliderBar = new PlayerSliderBar<double>
{ {
@ -31,7 +32,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "Background blur:" Text = GameplaySettingsStrings.BackgroundBlur
}, },
blurSliderBar = new PlayerSliderBar<double> blurSliderBar = new PlayerSliderBar<double>
{ {
@ -41,9 +42,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
Text = "Toggles:" Text = "Toggles:"
}, },
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboard / Video" }, showStoryboardToggle = new PlayerCheckbox { LabelText = GraphicsSettingsStrings.StoryboardVideo },
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" }, beatmapSkinsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapSkins },
beatmapColorsToggle = new PlayerCheckbox { LabelText = "Beatmap colours" }, beatmapColorsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapColours },
}; };
} }

View File

@ -9,9 +9,11 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
@ -127,8 +129,8 @@ namespace osu.Game.Screens.Ranking.Contracted
Spacing = new Vector2(0, 5), Spacing = new Vector2(0, 5),
Children = new[] Children = new[]
{ {
createStatistic("Max Combo", $"x{score.MaxCombo}"), createStatistic(BeatmapsetsStrings.ShowScoreboardHeadersCombo, $"x{score.MaxCombo}"),
createStatistic("Accuracy", $"{score.Accuracy.FormatAccuracy()}"), createStatistic(BeatmapsetsStrings.ShowScoreboardHeadersAccuracy, $"{score.Accuracy.FormatAccuracy()}"),
} }
}, },
new ModFlowDisplay new ModFlowDisplay
@ -200,7 +202,7 @@ namespace osu.Game.Screens.Ranking.Contracted
private Drawable createStatistic(HitResultDisplayStatistic result) private Drawable createStatistic(HitResultDisplayStatistic result)
=> createStatistic(result.DisplayName, result.MaxCount == null ? $"{result.Count}" : $"{result.Count}/{result.MaxCount}"); => createStatistic(result.DisplayName, result.MaxCount == null ? $"{result.Count}" : $"{result.Count}/{result.MaxCount}");
private Drawable createStatistic(string key, string value) => new Container private Drawable createStatistic(LocalisableString key, string value) => new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,

View File

@ -6,6 +6,7 @@ using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.Ranking.Expanded.Accuracy; using osu.Game.Screens.Ranking.Expanded.Accuracy;
using osu.Game.Utils; using osu.Game.Utils;
using osuTK; using osuTK;
@ -26,7 +27,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
/// </summary> /// </summary>
/// <param name="accuracy">The accuracy to display.</param> /// <param name="accuracy">The accuracy to display.</param>
public AccuracyStatistic(double accuracy) public AccuracyStatistic(double accuracy)
: base("accuracy") : base(BeatmapsetsStrings.ShowScoreboardHeadersAccuracy)
{ {
this.accuracy = accuracy; this.accuracy = accuracy;
} }

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.Ranking.Expanded.Accuracy; using osu.Game.Screens.Ranking.Expanded.Accuracy;
using osuTK; using osuTK;
@ -27,7 +28,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
/// <param name="combo">The combo to be displayed.</param> /// <param name="combo">The combo to be displayed.</param>
/// <param name="maxCombo">The maximum value of <paramref name="combo"/>.</param> /// <param name="maxCombo">The maximum value of <paramref name="combo"/>.</param>
public ComboStatistic(int combo, int? maxCombo) public ComboStatistic(int combo, int? maxCombo)
: base("combo", combo, maxCombo) : base(BeatmapsetsStrings.ShowScoreboardHeadersCombo, combo, maxCombo)
{ {
isPerfect = combo == maxCombo; isPerfect = combo == maxCombo;
} }

View File

@ -3,6 +3,7 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
@ -26,7 +27,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
/// <param name="header">The name of the statistic.</param> /// <param name="header">The name of the statistic.</param>
/// <param name="count">The value to display.</param> /// <param name="count">The value to display.</param>
/// <param name="maxCount">The maximum value of <paramref name="count"/>. Not displayed if null.</param> /// <param name="maxCount">The maximum value of <paramref name="count"/>. Not displayed if null.</param>
public CounterStatistic(string header, int count, int? maxCount = null) public CounterStatistic(LocalisableString header, int count, int? maxCount = null)
: base(header) : base(header)
{ {
this.count = count; this.count = count;

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.Ranking.Expanded.Statistics namespace osu.Game.Screens.Ranking.Expanded.Statistics
@ -23,7 +24,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
private RollingCounter<int> counter; private RollingCounter<int> counter;
public PerformanceStatistic(ScoreInfo score) public PerformanceStatistic(ScoreInfo score)
: base("PP") : base(BeatmapsetsStrings.ShowScoreboardHeaderspp)
{ {
this.score = score; this.score = score;
} }

View File

@ -3,10 +3,12 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -19,14 +21,14 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
{ {
protected SpriteText HeaderText { get; private set; } protected SpriteText HeaderText { get; private set; }
private readonly string header; private readonly LocalisableString header;
private Drawable content; private Drawable content;
/// <summary> /// <summary>
/// Creates a new <see cref="StatisticDisplay"/>. /// Creates a new <see cref="StatisticDisplay"/>.
/// </summary> /// </summary>
/// <param name="header">The name of the statistic.</param> /// <param name="header">The name of the statistic.</param>
protected StatisticDisplay(string header) protected StatisticDisplay(LocalisableString header)
{ {
this.header = header; this.header = header;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -60,7 +62,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
Text = header.ToUpperInvariant(), Text = header.ToUpper(),
} }
} }
}, },

View File

@ -16,6 +16,7 @@ using osu.Game.Online;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
using osu.Game.Overlays.BeatmapSet; using osu.Game.Overlays.BeatmapSet;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.Select.Details; using osu.Game.Screens.Select.Details;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -155,7 +156,7 @@ namespace osu.Game.Screens.Select
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = "Points of Failure", Text = BeatmapsetsStrings.ShowInfoPointsOfFailure,
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 14), Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 14),
}, },
failRetryGraph = new FailRetryGraph failRetryGraph = new FailRetryGraph

View File

@ -24,6 +24,7 @@ using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -136,14 +137,7 @@ namespace osu.Game.Screens.Select.Carousel
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "mapped by", Text = BeatmapsetsStrings.ShowDetailsMappedBy(beatmapInfo.Metadata.Author.Username),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft
},
new OsuSpriteText
{
Text = $"{beatmapInfo.Metadata.Author.Username}",
Font = OsuFont.GetFont(italics: true),
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft Origin = Anchor.BottomLeft
}, },
@ -235,7 +229,7 @@ namespace osu.Game.Screens.Select.Carousel
items.Add(new OsuMenuItem("Play", MenuItemType.Highlighted, () => startRequested(beatmapInfo))); items.Add(new OsuMenuItem("Play", MenuItemType.Highlighted, () => startRequested(beatmapInfo)));
if (editRequested != null) if (editRequested != null)
items.Add(new OsuMenuItem("Edit", MenuItemType.Standard, () => editRequested(beatmapInfo))); items.Add(new OsuMenuItem(CommonStrings.ButtonsEdit, MenuItemType.Standard, () => editRequested(beatmapInfo)));
if (beatmapInfo.OnlineID > 0 && beatmapOverlay != null) if (beatmapInfo.OnlineID > 0 && beatmapOverlay != null)
items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => beatmapOverlay.FetchAndShowBeatmap(beatmapInfo.OnlineID))); items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => beatmapOverlay.FetchAndShowBeatmap(beatmapInfo.OnlineID)));
@ -250,7 +244,7 @@ namespace osu.Game.Screens.Select.Carousel
} }
if (hideRequested != null) if (hideRequested != null)
items.Add(new OsuMenuItem("Hide", MenuItemType.Destructive, () => hideRequested(beatmapInfo))); items.Add(new OsuMenuItem(CommonStrings.ButtonsHide, MenuItemType.Destructive, () => hideRequested(beatmapInfo)));
return items.ToArray(); return items.ToArray();
} }

View File

@ -21,6 +21,7 @@ using osu.Framework.Localisation;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
namespace osu.Game.Screens.Select.Details namespace osu.Game.Screens.Select.Details
@ -63,10 +64,10 @@ namespace osu.Game.Screens.Select.Details
Children = new[] Children = new[]
{ {
FirstValue = new StatisticRow(), // circle size/key amount FirstValue = new StatisticRow(), // circle size/key amount
HpDrain = new StatisticRow { Title = "HP Drain" }, HpDrain = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsDrain },
Accuracy = new StatisticRow { Title = "Accuracy" }, Accuracy = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAccuracy },
ApproachRate = new StatisticRow { Title = "Approach Rate" }, ApproachRate = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAr },
starDifficulty = new StatisticRow(10, true) { Title = "Star Difficulty" }, starDifficulty = new StatisticRow(10, true) { Title = BeatmapsetsStrings.ShowStatsStars },
}, },
}; };
} }
@ -120,12 +121,12 @@ namespace osu.Game.Screens.Select.Details
case 3: case 3:
// Account for mania differences locally for now // Account for mania differences locally for now
// Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes
FirstValue.Title = "Key Count"; FirstValue.Title = BeatmapsetsStrings.ShowStatsCsMania;
FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null); FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null);
break; break;
default: default:
FirstValue.Title = "Circle Size"; FirstValue.Title = BeatmapsetsStrings.ShowStatsCs;
FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize); FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize);
break; break;
} }

View File

@ -2,36 +2,38 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using System.ComponentModel;
using osu.Framework.Localisation;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Screens.Select.Filter namespace osu.Game.Screens.Select.Filter
{ {
public enum SortMode public enum SortMode
{ {
[Description("Artist")] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.ListingSearchSortingArtist))]
Artist, Artist,
[Description("Author")] [Description("Author")]
Author, Author,
[Description("BPM")] [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowStatsBpm))]
BPM, BPM,
[Description("Date Added")] [Description("Date Added")]
DateAdded, DateAdded,
[Description("Difficulty")] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.ListingSearchSortingDifficulty))]
Difficulty, Difficulty,
[Description("Length")] [LocalisableDescription(typeof(SortStrings), nameof(SortStrings.ArtistTracksLength))]
Length, Length,
[Description("Rank Achieved")] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.ListingSearchFiltersRank))]
RankAchieved, RankAchieved,
[Description("Source")] [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowInfoSource))]
Source, Source,
[Description("Title")] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.ListingSearchSortingTitle))]
Title, Title,
} }
} }

View File

@ -14,6 +14,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Screens.Select.Filter; using osu.Game.Screens.Select.Filter;
using osuTK; using osuTK;
@ -139,7 +140,7 @@ namespace osu.Game.Screens.Select
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "Sort by", Text = SortStrings.Default,
Font = OsuFont.GetFont(size: 14), Font = OsuFont.GetFont(size: 14),
Margin = new MarginPadding(5), Margin = new MarginPadding(5),
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,

View File

@ -13,6 +13,7 @@ using osuTK.Input;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using System.Linq; using System.Linq;
using osu.Framework.Localisation;
namespace osu.Game.Screens.Select.Options namespace osu.Game.Screens.Select.Options
{ {
@ -63,7 +64,7 @@ namespace osu.Game.Screens.Select.Options
/// <param name="colour">Colour of the button.</param> /// <param name="colour">Colour of the button.</param>
/// <param name="icon">Icon of the button.</param> /// <param name="icon">Icon of the button.</param>
/// <param name="action">Binding the button does.</param> /// <param name="action">Binding the button does.</param>
public void AddButton(string firstLine, string secondLine, IconUsage icon, Color4 colour, Action action) public void AddButton(LocalisableString firstLine, string secondLine, IconUsage icon, Color4 colour, Action action)
{ {
var button = new BeatmapOptionsButton var button = new BeatmapOptionsButton
{ {

View File

@ -1,20 +1,22 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Users namespace osu.Game.Users
{ {
public abstract class UserStatus public abstract class UserStatus
{ {
public abstract string Message { get; } public abstract LocalisableString Message { get; }
public abstract Color4 GetAppropriateColour(OsuColour colours); public abstract Color4 GetAppropriateColour(OsuColour colours);
} }
public class UserStatusOnline : UserStatus public class UserStatusOnline : UserStatus
{ {
public override string Message => @"Online"; public override LocalisableString Message => UsersStrings.StatusOnline;
public override Color4 GetAppropriateColour(OsuColour colours) => colours.GreenLight; public override Color4 GetAppropriateColour(OsuColour colours) => colours.GreenLight;
} }
@ -25,13 +27,13 @@ namespace osu.Game.Users
public class UserStatusOffline : UserStatus public class UserStatusOffline : UserStatus
{ {
public override string Message => @"Offline"; public override LocalisableString Message => UsersStrings.StatusOffline;
public override Color4 GetAppropriateColour(OsuColour colours) => Color4.Black; public override Color4 GetAppropriateColour(OsuColour colours) => Color4.Black;
} }
public class UserStatusDoNotDisturb : UserStatus public class UserStatusDoNotDisturb : UserStatus
{ {
public override string Message => @"Do not disturb"; public override LocalisableString Message => "Do not disturb";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.RedDark; public override Color4 GetAppropriateColour(OsuColour colours) => colours.RedDark;
} }
} }