From ab9340f4be8ab5410177a0eb4b611437177a28b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 11:34:06 +0200 Subject: [PATCH 1/3] Fix usage of culture local ToUpper causing incorrect display on Turkish machines Closes #3098. --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 ++- osu.Game/Overlays/Chat/ChannelSection.cs | 3 ++- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 ++- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 ++++--- osu.Game/Overlays/OnScreenDisplay.cs | 5 +++-- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 ++- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 ++- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 ++- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 ++- osu.Game/Screens/Tournament/Drawings.cs | 3 ++- osu.Game/Screens/Tournament/Group.cs | 5 +++-- 11 files changed, 26 insertions(+), 15 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 24e6021421..4e92f49937 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -23,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 89d9d2231c..2d0c406ef2 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -30,7 +31,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(); } + set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index ce79e70b1c..222c966a2b 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -62,7 +63,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(), + Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index c166624d2b..1537c65a1f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -55,7 +56,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(); + if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); } } @@ -101,7 +102,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(), + Text = title.ToUpper(CultureInfo.InvariantCulture), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -154,7 +155,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(); } + set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 5a5b90ee25..ba5bb9c49e 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -176,9 +177,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(); + textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(); + textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 82589a99bd..4498828118 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(), + Text = Header.ToUpper(CultureInfo.InvariantCulture), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 74ee025823..6fa10977d0 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -51,7 +52,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(), + Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index 77c9c967b4..fb7f6cd03b 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -28,7 +29,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(), + Text = "current progress".ToUpper(CultureInfo.InvariantCulture), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 1813d02d02..9a17e7708b 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -94,7 +95,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(), + Text = Title.ToUpper(CultureInfo.InvariantCulture), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 49a46b96e3..7bc8217329 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -323,7 +324,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper().StartsWith("GROUP")) + if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index b1bcd6052c..f62c26a62e 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper()}", + Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -161,7 +162,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(), + Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), TextSize = 10f, Font = @"Exo2.0-Bold" } From 5364a6148a2b6adcbd77fbde14359cc1d6b9b259 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 14:42:06 +0200 Subject: [PATCH 2/3] Use ToUpperInvariant --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 +-- osu.Game/Overlays/Chat/ChannelSection.cs | 3 +-- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 +-- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 +++---- osu.Game/Overlays/OnScreenDisplay.cs | 5 ++--- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 +-- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 +-- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 +-- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 +-- osu.Game/Screens/Tournament/Drawings.cs | 3 +-- osu.Game/Screens/Tournament/Group.cs | 5 ++--- 11 files changed, 15 insertions(+), 26 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 4e92f49937..c7e97cef55 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -24,7 +23,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpperInvariant(); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 2d0c406ef2..85fdecaaba 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -31,7 +30,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { header.Text = value.ToUpperInvariant(); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index 222c966a2b..a27278e002 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -63,7 +62,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), + Text = "Medal Unlocked".ToUpperInvariant(), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 1537c65a1f..f41e3e876f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -56,7 +55,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); + if (titleText != null) titleText.Text = title.ToUpperInvariant(); } } @@ -102,7 +101,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(CultureInfo.InvariantCulture), + Text = title.ToUpperInvariant(), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -155,7 +154,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { text.Text = value.ToUpperInvariant(); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index ba5bb9c49e..041ceab365 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -177,9 +176,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); + textLine1.Text = description.Name.ToUpperInvariant(); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); + textLine3.Text = description.Shortcut.ToUpperInvariant(); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 4498828118..9296972749 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(CultureInfo.InvariantCulture), + Text = Header.ToUpperInvariant(), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 6fa10977d0..5de14ae579 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -52,7 +51,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), + Text = Judgement.Result.GetDescription().ToUpperInvariant(), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index fb7f6cd03b..51d39762d2 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -29,7 +28,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(CultureInfo.InvariantCulture), + Text = "current progress".ToUpperInvariant(), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 9a17e7708b..c4767f404d 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -95,7 +94,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(CultureInfo.InvariantCulture), + Text = Title.ToUpperInvariant(), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 7bc8217329..63d29d5cd7 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -324,7 +323,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) + if (line.ToUpperInvariant().StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index f62c26a62e..6845d8fc48 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", + Text = $"GROUP {name.ToUpperInvariant()}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -162,7 +161,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), + Text = team.Acronym.ToUpperInvariant(), TextSize = 10f, Font = @"Exo2.0-Bold" } From da8fc0ee5dd169946155aa4150bf34354c14255e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Jul 2018 07:37:05 +0200 Subject: [PATCH 3/3] ToLower -> ToLowerInvariant --- osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs | 4 ++-- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 2 +- osu.Game/Graphics/ScreenshotManager.cs | 2 +- osu.Game/Online/API/Requests/GetUserScoresRequest.cs | 2 +- osu.Game/Online/API/Requests/PostMessageRequest.cs | 2 +- osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 4 ++-- osu.Game/Screens/Multi/Header.cs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs index 64ed08373a..fdc8f362f7 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs @@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableNote(note) { AccentColour = Color4.OrangeRed } } @@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableHoldNote(note) { diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 52d9f31814..26f28c86ca 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -312,7 +312,7 @@ namespace osu.Game.Beatmaps.Formats omitFirstBarSignature = effectFlags.HasFlag(EffectFlags.OmitFirstBarLine); } - string stringSampleSet = sampleSet.ToString().ToLower(); + string stringSampleSet = sampleSet.ToString().ToLowerInvariant(); if (stringSampleSet == @"none") stringSampleSet = @"normal"; diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index 90580c50df..7b3337cb23 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -134,7 +134,7 @@ namespace osu.Game.Graphics private string getFileName() { var dt = DateTime.Now; - var fileExt = screenshotFormat.ToString().ToLower(); + var fileExt = screenshotFormat.ToString().ToLowerInvariant(); var withoutIndex = $"osu_{dt:yyyy-MM-dd_HH-mm-ss}.{fileExt}"; if (!storage.Exists(withoutIndex)) diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index ea14135a61..4d4aa4d957 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}"; + protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}?offset={offset}"; } public enum ScoreType diff --git a/osu.Game/Online/API/Requests/PostMessageRequest.cs b/osu.Game/Online/API/Requests/PostMessageRequest.cs index 44429bdcd5..e0a9fb83b2 100644 --- a/osu.Game/Online/API/Requests/PostMessageRequest.cs +++ b/osu.Game/Online/API/Requests/PostMessageRequest.cs @@ -23,7 +23,7 @@ namespace osu.Game.Online.API.Requests req.Method = HttpMethod.POST; req.AddParameter(@"target_type", message.TargetType.GetDescription()); req.AddParameter(@"target_id", message.TargetId.ToString()); - req.AddParameter(@"is_action", message.IsAction.ToString().ToLower()); + req.AddParameter(@"is_action", message.IsAction.ToString().ToLowerInvariant()); req.AddParameter(@"message", message.Content); return req; diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 2a154d1230..3c808d1bee 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -29,7 +29,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLower()}_{directionString}"; + protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}"; } public enum BeatmapSearchCategory diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 0ac8e585f8..c48060bfa9 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -197,10 +197,10 @@ namespace osu.Game.Rulesets.Objects.Legacy var bank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[0]); var addbank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[1]); - string stringBank = bank.ToString().ToLower(); + string stringBank = bank.ToString().ToLowerInvariant(); if (stringBank == @"none") stringBank = null; - string stringAddBank = addbank.ToString().ToLower(); + string stringAddBank = addbank.ToString().ToLowerInvariant(); if (stringAddBank == @"none") stringAddBank = null; diff --git a/osu.Game/Screens/Multi/Header.cs b/osu.Game/Screens/Multi/Header.cs index 46610a36d8..809fc25083 100644 --- a/osu.Game/Screens/Multi/Header.cs +++ b/osu.Game/Screens/Multi/Header.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Multi }, }; - breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLower(); + breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLowerInvariant(); breadcrumbs.Current.TriggerChange(); }