From 5f9a69e5c2f060cbcc2143f53cc7938953a94509 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 30 May 2022 17:19:03 +0900 Subject: [PATCH] Add localisation --- .../Localisation/LayoutSettingsStrings.cs | 29 +++++++++++++++++++ .../Sections/Graphics/LayoutSettings.cs | 6 ++-- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 osu.Game/Localisation/LayoutSettingsStrings.cs diff --git a/osu.Game/Localisation/LayoutSettingsStrings.cs b/osu.Game/Localisation/LayoutSettingsStrings.cs new file mode 100644 index 0000000000..5ac28f19b3 --- /dev/null +++ b/osu.Game/Localisation/LayoutSettingsStrings.cs @@ -0,0 +1,29 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Localisation; + +namespace osu.Game.Localisation +{ + public static class LayoutSettingsStrings + { + private const string prefix = @"osu.Game.Resources.Localisation.LayoutSettings"; + + /// + /// "Checking for fullscreen capabilities..." + /// + public static LocalisableString CheckingForFullscreenCapabilities => new TranslatableString(getKey(@"checking_for_fullscreen_capabilities"), @"Checking for fullscreen capabilities..."); + + /// + /// "osu! is running exclusive fullscreen, guaranteeing low latency!" + /// + public static LocalisableString OsuIsRunningExclusiveFullscreen => new TranslatableString(getKey(@"osu_is_running_exclusive_fullscreen"), @"osu! is running exclusive fullscreen, guaranteeing low latency!"); + + /// + /// "Unable to run exclusive fullscreen. You'll still experience some input latency." + /// + public static LocalisableString UnableToRunExclusiveFullscreen => new TranslatableString(getKey(@"unable_to_run_exclusive_fullscreen"), @"Unable to run exclusive fullscreen. You'll still experience some input latency."); + + private static string getKey(string key) => $@"{prefix}:{key}"; + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index acbcdfcf76..69a50c19b4 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -234,15 +234,15 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics { case FullscreenCapability.Unknown: if (host.Window is WindowsWindow) - windowModeDropdown.WarningText = "Checking for fullscreen capabilities..."; + windowModeDropdown.WarningText = LayoutSettingsStrings.CheckingForFullscreenCapabilities; break; case FullscreenCapability.Capable: - windowModeDropdown.WarningText = "osu! is running exclusive fullscreen, guaranteeing low latency!"; + windowModeDropdown.WarningText = LayoutSettingsStrings.OsuIsRunningExclusiveFullscreen; break; case FullscreenCapability.Incapable: - windowModeDropdown.WarningText = "Unable to run exclusive fullscreen. You'll still experience some input latency."; + windowModeDropdown.WarningText = LayoutSettingsStrings.UnableToRunExclusiveFullscreen; break; } }