1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

GameplayMenuOverlay.cs: add translatable strings for Retry count: and Song progress:

This makes the assumption that languages will prefer having the number on the right
This commit is contained in:
Robin Oger 2023-05-27 12:47:05 +02:00
parent a01577cba5
commit cfa1280028
2 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,4 @@
// 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.
using osu.Framework.Localisation;
@ -34,6 +34,16 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString PausedHeader => new TranslatableString(getKey(@"paused_header"), @"paused");
/// <summary>
/// "Retry count: "
/// </summary>
public static LocalisableString RetryCount => new TranslatableString(getKey(@"retry_count"), @"Retry count: ");
/// <summary>
/// "Song progress: "
/// </summary>
public static LocalisableString SongProgress => new TranslatableString(getKey(@"song_progress"), @"Song progress: ");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -21,6 +21,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osuTK;
using osuTK.Graphics;
using osu.Game.Localisation;
namespace osu.Game.Screens.Play
{
@ -210,13 +211,13 @@ namespace osu.Game.Screens.Play
private void updateInfoText()
{
playInfoText.Clear();
playInfoText.AddText("Retry count: ");
playInfoText.AddText(GameplayMenuOverlayStrings.RetryCount);
playInfoText.AddText(retries.ToString(), cp => cp.Font = cp.Font.With(weight: FontWeight.Bold));
if (getSongProgress() is int progress)
{
playInfoText.NewLine();
playInfoText.AddText("Song progress: ");
playInfoText.AddText(GameplayMenuOverlayStrings.SongProgress);
playInfoText.AddText($"{progress}%", cp => cp.Font = cp.Font.With(weight: FontWeight.Bold));
}
}