From 770e3634e7e68a0713d6a250bd47fd3fac4b02ba Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 13 Aug 2024 13:43:33 +0300 Subject: [PATCH] Fix daily challenge stats display suffix not displayed --- .../Header/Components/DailyChallengeStatsDisplay.cs | 5 ++++- .../Header/Components/DailyChallengeStatsTooltip.cs | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsDisplay.cs b/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsDisplay.cs index f55eb595d7fd..9b56e5b256a9 100644 --- a/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsDisplay.cs +++ b/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsDisplay.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -106,7 +107,9 @@ private void updateDisplay() APIUserDailyChallengeStatistics stats = User.Value.User.DailyChallengeStatistics; - dailyPlayCount.Text = UsersStrings.ShowDailyChallengeUnitDay(stats.PlayCount.ToLocalisableString("N0")); + // todo: ideally we want to use UsersStrings.ShowDailyChallengeUnit{Day,Week}(...), but it's broken right now. + // see: https://github.com/ppy/osu/issues/29355#issuecomment-2277139889 + dailyPlayCount.Text = LocalisableString.Interpolate($"{1234.ToLocalisableString("N0")}d"); dailyPlayCount.Colour = colours.ForRankingTier(tierForPlayCount(stats.PlayCount)); TooltipContent = new DailyChallengeTooltipData(colourProvider, stats); diff --git a/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsTooltip.cs b/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsTooltip.cs index 1b54633b8a9d..9f3b6a56f3b0 100644 --- a/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsTooltip.cs +++ b/osu.Game/Overlays/Profile/Header/Components/DailyChallengeStatsTooltip.cs @@ -112,16 +112,18 @@ public void SetContent(DailyChallengeTooltipData content) background.Colour = colourProvider.Background4; topBackground.Colour = colourProvider.Background5; - currentDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(content.Statistics.DailyStreakCurrent.ToLocalisableString(@"N0")); + // todo: ideally we want to use UsersStrings.ShowDailyChallengeUnit{Day,Week}(...), but it's broken right now. + // see: https://github.com/ppy/osu/issues/29355#issuecomment-2277139889 + currentDaily.Value = LocalisableString.Interpolate($"{statistics.DailyStreakCurrent.ToLocalisableString("N0")}d"); currentDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakCurrent)); - currentWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0")); + currentWeekly.Value = LocalisableString.Interpolate($"{statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0")}w"); currentWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakCurrent)); - bestDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(statistics.DailyStreakBest.ToLocalisableString(@"N0")); + bestDaily.Value = LocalisableString.Interpolate($"{statistics.DailyStreakBest.ToLocalisableString(@"N0")}d"); bestDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakBest)); - bestWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakBest.ToLocalisableString(@"N0")); + bestWeekly.Value = LocalisableString.Interpolate($"{statistics.WeeklyStreakBest.ToLocalisableString(@"N0")}w"); bestWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakBest)); topTen.Value = statistics.Top10PercentPlacements.ToLocalisableString(@"N0");