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

Merge pull request #27015 from Loreos7/settings-remaining-strings-localisation

Localise remaining strings in settings section
This commit is contained in:
Bartłomiej Dach 2024-02-05 20:00:42 +01:00 committed by GitHub
commit aff7e1fb8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 39 additions and 7 deletions

View File

@ -1,9 +1,10 @@
// 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.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Localisation;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Taiko.Configuration;
@ -27,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko
{
new SettingsEnumDropdown<TaikoTouchControlScheme>
{
LabelText = "Touch control scheme",
LabelText = RulesetSettingsStrings.TouchControlScheme,
Current = config.GetBindable<TaikoTouchControlScheme>(TaikoRulesetSetting.TouchControlScheme)
}
};

View File

@ -64,6 +64,21 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString AudioOffset => new TranslatableString(getKey(@"audio_offset"), @"Audio offset");
/// <summary>
/// "Play a few beatmaps to receive a suggested offset!"
/// </summary>
public static LocalisableString SuggestedOffsetNote => new TranslatableString(getKey(@"suggested_offset_note"), @"Play a few beatmaps to receive a suggested offset!");
/// <summary>
/// "Based on the last {0} play(s), the suggested offset is {1} ms."
/// </summary>
public static LocalisableString SuggestedOffsetValueReceived(int plays, LocalisableString value) => new TranslatableString(getKey(@"suggested_offset_value_received"), @"Based on the last {0} play(s), the suggested offset is {1} ms.", plays, value);
/// <summary>
/// "Apply suggested offset"
/// </summary>
public static LocalisableString ApplySuggestedOffset => new TranslatableString(getKey(@"apply_suggested_offset"), @"Apply suggested offset");
/// <summary>
/// "Offset wizard"
/// </summary>

View File

@ -29,6 +29,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString ImportFiles => new TranslatableString(getKey(@"import_files"), @"Import files");
/// <summary>
/// "Run latency certifier"
/// </summary>
public static LocalisableString RunLatencyCertifier => new TranslatableString(getKey(@"run_latency_certifier"), @"Run latency certifier");
/// <summary>
/// "Memory"
/// </summary>

View File

@ -159,6 +159,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString MinimiseOnFocusLoss => new TranslatableString(getKey(@"minimise_on_focus_loss"), @"Minimise osu! when switching to another app");
/// <summary>
/// "Shrink game to avoid cameras and notches"
/// </summary>
public static LocalisableString ShrinkGameToSafeArea => new TranslatableString(getKey(@"shrink_game_to_safe_area"), @"Shrink game to avoid cameras and notches");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -84,6 +84,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString ScrollSpeedTooltip(int scrollTime, int scrollSpeed) => new TranslatableString(getKey(@"ruleset"), @"{0}ms (speed {1})", scrollTime, scrollSpeed);
/// <summary>
/// "Touch control scheme"
/// </summary>
public static LocalisableString TouchControlScheme => new TranslatableString(getKey(@"touch_control_scheme"), @"Touch control scheme");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -8,6 +8,7 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -91,7 +92,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
applySuggestion = new RoundedButton
{
RelativeSizeAxes = Axes.X,
Text = "Apply suggested offset",
Text = AudioSettingsStrings.ApplySuggestedOffset,
Action = () =>
{
if (SuggestedOffset.Value.HasValue)
@ -155,8 +156,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
private void updateHintText()
{
hintText.Text = SuggestedOffset.Value == null
? @"Play a few beatmaps to receive a suggested offset!"
: $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {SuggestedOffset.Value:N0} ms.";
? AudioSettingsStrings.SuggestedOffsetNote
: AudioSettingsStrings.SuggestedOffsetValueReceived(averageHitErrorHistory.Count, SuggestedOffset.Value.ToLocalisableString(@"N0"));
applySuggestion.Enabled.Value = SuggestedOffset.Value != null;
}

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
},
new SettingsButton
{
Text = @"Run latency certifier",
Text = DebugSettingsStrings.RunLatencyCertifier,
Action = () => performer?.PerformFromScreen(menu => menu.Push(new LatencyCertifierScreen()))
}
};

View File

@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
},
safeAreaConsiderationsCheckbox = new SettingsCheckbox
{
LabelText = "Shrink game to avoid cameras and notches",
LabelText = GraphicsSettingsStrings.ShrinkGameToSafeArea,
Current = osuConfig.GetBindable<bool>(OsuSetting.SafeAreaConsiderations),
},
new SettingsSlider<float, UIScaleSlider>