Use existing web localisation for most hardcoded strings

This commit is contained in:
Joseph Madamba
2022-01-27 20:53:48 -08:00
parent fb5fcdd083
commit 5e5c8e78a6
70 changed files with 224 additions and 147 deletions

View File

@ -3,6 +3,7 @@
using System;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
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)
{
Type = type;

View File

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

View File

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

View File

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

View File

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