Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions osu.Game/Localisation/DailyChallengeStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,56 @@ public static class DailyChallengeStrings
/// </summary>
public static LocalisableString ChallengeLiveNotification => new TranslatableString(getKey(@"todays_daily_challenge_is_now"), @"Today's daily challenge is now live! Click here to play.");

/// <summary>
/// "Today&#39;s Challenge"
/// </summary>
public static LocalisableString TodaysChallenge => new TranslatableString(getKey(@"todays_challenge"), @"Today's Challenge");

/// <summary>
/// "Difficulty: {0}"
/// </summary>
public static LocalisableString DifficultyInfo(string difficultyName) => new TranslatableString(getKey(@"difficulty_info"), @"Difficulty: {0}", difficultyName);

/// <summary>
/// "Time remaining"
/// </summary>
public static LocalisableString SectionTimeRemaining => new TranslatableString(getKey(@"section_time_remaining"), @"Time remaining");

/// <summary>
/// "Score breakdown"
/// </summary>
public static LocalisableString SectionScoreBreakdown => new TranslatableString(getKey(@"section_score_breakdown"), @"Score breakdown");

/// <summary>
/// "Total pass count"
/// </summary>
public static LocalisableString SectionTotalPasses => new TranslatableString(getKey(@"section_total_passes"), @"Total pass count");

/// <summary>
/// "Cumulative total score"
/// </summary>
public static LocalisableString SectionCumulativeScore => new TranslatableString(getKey(@"section_cumulative_score"), @"Cumulative total score");

/// <summary>
/// "Events"
/// </summary>
public static LocalisableString SectionEvents => new TranslatableString(getKey(@"section_events"), @"Events");

/// <summary>
/// "remaining"
/// </summary>
public static LocalisableString Remaining => new TranslatableString(getKey(@"remaining"), @"remaining");

/// <summary>
/// "You"
/// </summary>
public static LocalisableString You => new TranslatableString(getKey(@"you"), @"You");

/// <summary>
/// "{0:N0} passes in {1:N0} - {2:N0} range"
/// </summary>
public static LocalisableString ScoreBreakdownBarTooltip(long passesCount, int minScore, int maxScore) => new TranslatableString(getKey(@"score_breakdown_bar_tooltip"), @"{0:N0} passes in {1:N0} - {2:N0} range", passesCount, minScore, maxScore);

private static string getKey(string key) => $@"{prefix}:{key}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ [new MatchChatDisplay(room) { RelativeSizeAxes = Axes.Both }]
{
footerButtons.Insert(-1, new UserModSelectButton
{
Text = "Free mods",
Text = OnlinePlayStrings.FooterButtonFreemods,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Screens.OnlinePlay.DailyChallenge.Events;
using osu.Game.Users.Drawables;
using osuTK;
Expand All @@ -30,7 +31,7 @@ private void load()
{
InternalChildren = new Drawable[]
{
new SectionHeader("Events"),
new SectionHeader(DailyChallengeStrings.SectionEvents),
new Container
{
RelativeSizeAxes = Axes.Both,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Localisation;
using osu.Game.Online;
using osu.Game.Online.Rooms;
using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets;
using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Screens.Play.HUD;
Expand Down Expand Up @@ -145,7 +147,7 @@ private void load(RulesetStore rulesets, BeatmapDifficultyCache difficultyCache,
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = "Today's Challenge",
Text = DailyChallengeStrings.TodaysChallenge,
Margin = new MarginPadding { Horizontal = 10f, Vertical = 5f },
Shear = -OsuGame.SHEAR,
Font = OsuFont.GetFont(size: 32, weight: FontWeight.Light, typeface: Typeface.TorusAlternate),
Expand Down Expand Up @@ -254,7 +256,7 @@ private void load(RulesetStore rulesets, BeatmapDifficultyCache difficultyCache,
},
new TruncatingSpriteText
{
Text = $"Difficulty: {beatmap.DifficultyName}",
Text = DailyChallengeStrings.DifficultyInfo(beatmap.DifficultyName),
Font = OsuFont.GetFont(size: 20, italics: true),
MaxWidth = horizontal_info_size,
Shear = -OsuGame.SHEAR,
Expand All @@ -263,7 +265,7 @@ private void load(RulesetStore rulesets, BeatmapDifficultyCache difficultyCache,
},
new TruncatingSpriteText
{
Text = $"by {beatmap.Metadata.Author.Username}",
Text = BeatmappacksStrings.ShowCreatedBy(beatmap.Metadata.Author.Username),
Font = OsuFont.GetFont(size: 16, italics: true),
MaxWidth = horizontal_info_size,
Shear = -OsuGame.SHEAR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets;
Expand Down Expand Up @@ -80,7 +81,7 @@ private void load()
],
Content = new[]
{
new Drawable[] { new SectionHeader("Leaderboard") },
new Drawable[] { new SectionHeader(OnlinePlayStrings.PlaylistLeaderboard) },
new Drawable[]
{
new Container
Expand Down Expand Up @@ -109,7 +110,7 @@ private void load()
}
}
},
new Drawable[] { userBestHeader = new SectionHeader("Personal best") { Alpha = 0, } },
new Drawable[] { userBestHeader = new SectionHeader(BeatmapLeaderboardWedgeStrings.PersonalBest) { Alpha = 0, } },
new Drawable[]
{
userBestContainer = new Container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.Metadata;
using osu.Game.Online.Rooms;
using osu.Game.Overlays;
Expand All @@ -36,7 +37,7 @@ private void load()
{
InternalChildren = new Drawable[]
{
new SectionHeader("Score breakdown"),
new SectionHeader(DailyChallengeStrings.SectionScoreBreakdown),
barsContainer = new FillFlowContainer<Bar>
{
Direction = FillDirection.Horizontal,
Expand Down Expand Up @@ -215,7 +216,7 @@ private void load(OverlayColourProvider colourProvider)
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Colour = colours.Orange1,
Text = "You",
Text = DailyChallengeStrings.You,
Font = OsuFont.Default.With(weight: FontWeight.Bold),
Alpha = 0,
RelativePositionAxes = Axes.Y,
Expand Down Expand Up @@ -285,7 +286,7 @@ public void UpdateCounts(long newCount, long newMax)
flashLayer.FadeOutFromOne(600, Easing.OutQuint);
}

public LocalisableString TooltipText => LocalisableString.Format("{0:N0} passes in {1:N0} - {2:N0} range", count, BinStart, BinEnd);
public LocalisableString TooltipText => DailyChallengeStrings.ScoreBreakdownBarTooltip(count, BinStart, BinEnd);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Online.Rooms;
using osu.Game.Overlays;
using osuTK;
Expand Down Expand Up @@ -40,7 +41,7 @@ private void load()
{
InternalChildren = new Drawable[]
{
new SectionHeader("Time remaining"),
new SectionHeader(DailyChallengeStrings.SectionTimeRemaining),
new DrawSizePreservingFillContainer
{
RelativeSizeAxes = Axes.Both,
Expand Down Expand Up @@ -83,7 +84,7 @@ private void load()
},
new OsuSpriteText
{
Text = "remaining",
Text = DailyChallengeStrings.Remaining,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if this string can be correctly localised in this context, i would prefer to remove this element from it altogether, but then the timer will look too empty

Font = OsuFont.Default.With(size: 20),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Screens.OnlinePlay.DailyChallenge.Events;
using osuTK;

Expand Down Expand Up @@ -42,7 +43,7 @@ private void load()
{
new Drawable[]
{
new SectionHeader("Total pass count")
new SectionHeader(DailyChallengeStrings.SectionTotalPasses)
},
new Drawable[]
{
Expand All @@ -60,7 +61,7 @@ private void load()
},
new Drawable[]
{
new SectionHeader("Cumulative total score")
new SectionHeader(DailyChallengeStrings.SectionCumulativeScore)
},
new Drawable[]
{
Expand Down
Loading