Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change most ruleset-accessible string types to Localisable strings #19695

Merged
merged 16 commits into from
Aug 22, 2022
Merged
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
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/CatchRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using osu.Game.Rulesets.Scoring;
using System;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Catch.Edit;
using osu.Game.Rulesets.Catch.Skinning.Legacy;
using osu.Game.Rulesets.Edit;
Expand Down Expand Up @@ -162,7 +163,7 @@ protected override IEnumerable<HitResult> GetValidHitResults()
};
}

public override string GetDisplayNameForHitResult(HitResult result)
public override LocalisableString GetDisplayNameForHitResult(HitResult result)
{
switch (result)
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// 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.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModEasy : ModEasyWithExtraLives
{
public override string Description => @"Larger fruits, more forgiving HP drain, less accuracy required, and three lives!";
public override LocalisableString Description => @"Larger fruits, more forgiving HP drain, less accuracy required, and three lives!";
}
}
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModFloatingFruits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
Expand All @@ -14,7 +15,7 @@ public class CatchModFloatingFruits : Mod, IApplicableToDrawableRuleset<CatchHit
{
public override string Name => "Floating Fruits";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume the reason why mod names aren't also being localised here is their widespread usage, correct?

Copy link
Contributor Author

@naoei naoei Aug 14, 2022

Choose a reason for hiding this comment

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

That is correct. I can change it into a localisable string if preferred.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Definitely not in this diff. There are many concerns to figure out with regard to that, including but not limited to how to share translations with web, or how to adapt several dependent projects like osu-tools.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the issue there? I think we can still reference osu.Resources from the rulesets.

I think if we're going to break Description, we should also break Name, otherwise we'll end up breaking rulesets twice over: https://github.com/taulazer/tau/blob/master/osu.Game.Rulesets.Tau/Mods/TauModDual.cs

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should be localising mod names. They historically haven't been, as they are treated as proper nouns.

Copy link
Contributor

Choose a reason for hiding this comment

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

But you can transliterate proper nouns, as is done in Korean: https://osu.ppy.sh/wiki/ko/Gameplay/Game_modifier/Double_Time (lit. deobeul taim). I'm also seeing whisperings on the Japanese net about ハードロック and ダブルタイム.

Are you sure you want to keep these as latin characters?

Copy link
Member

Choose a reason for hiding this comment

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

It's a valid direction, but we need to decide and make sure everyone is on board with it. That shouldn't be in the PR, as I think there will be diverging opinions on it.

Currently they aren't translated in stable (or osu-web to my knowledge).

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough.

public override string Acronym => "FF";
public override string Description => "The fruits are... floating?";
public override LocalisableString Description => "The fruits are... floating?";
public override double ScoreMultiplier => 1;
public override IconUsage? Icon => FontAwesome.Solid.Cloud;

Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Catch.UI;
Expand All @@ -14,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModHidden : ModHidden, IApplicableToDrawableRuleset<CatchHitObject>
{
public override string Description => @"Play with fading fruits.";
public override LocalisableString Description => @"Play with fading fruits.";
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;

private const double fade_out_offset_multiplier = 0.6;
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModMirror.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
Expand All @@ -14,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModMirror : ModMirror, IApplicableToBeatmap
{
public override string Description => "Fruits are flipped horizontally.";
public override LocalisableString Description => "Fruits are flipped horizontally.";

/// <remarks>
/// <see cref="IApplicableToBeatmap"/> is used instead of <see cref="IApplicableToHitObject"/>,
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mods;
using osu.Framework.Utils;
using osu.Game.Configuration;
Expand All @@ -14,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModNoScope : ModNoScope, IUpdatableByPlayfield
{
public override string Description => "Where's the catcher?";
public override LocalisableString Description => "Where's the catcher?";

[SettingSource(
"Hidden at combo",
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Mods;
Expand All @@ -16,7 +17,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModRelax : ModRelax, IApplicableToDrawableRuleset<CatchHitObject>, IApplicableToPlayer
{
public override string Description => @"Use the mouse to control the catcher.";
public override LocalisableString Description => @"Use the mouse to control the catcher.";

private DrawableRuleset<CatchHitObject> drawableRuleset = null!;

Expand Down
5 changes: 3 additions & 2 deletions osu.Game.Rulesets.Mania/ManiaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mania.Replays;
using osu.Game.Rulesets.Replays.Types;
Expand Down Expand Up @@ -311,7 +312,7 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0)
return Array.Empty<KeyBinding>();
}

public override string GetVariantName(int variant)
public override LocalisableString GetVariantName(int variant)
{
switch (getPlayfieldType(variant))
{
Expand Down Expand Up @@ -356,7 +357,7 @@ protected override IEnumerable<HitResult> GetValidHitResults()
};
}

public override string GetDisplayNameForHitResult(HitResult result)
public override LocalisableString GetDisplayNameForHitResult(HitResult result)
{
switch (result)
{
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModConstantSpeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.UI;
Expand All @@ -18,7 +19,7 @@ public class ManiaModConstantSpeed : Mod, IApplicableToDrawableRuleset<ManiaHitO

public override double ScoreMultiplier => 0.9;

public override string Description => "No more tricky speed changes!";
public override LocalisableString Description => "No more tricky speed changes!";

public override IconUsage? Icon => FontAwesome.Solid.Equals;

Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mods;
Expand All @@ -11,7 +12,7 @@ public class ManiaModDualStages : Mod, IPlayfieldTypeMod, IApplicableToBeatmapCo
{
public override string Name => "Dual Stages";
public override string Acronym => "DS";
public override string Description => @"Double the stages, double the fun!";
public override LocalisableString Description => @"Double the stages, double the fun!";
public override ModType Type => ModType.Conversion;
public override double ScoreMultiplier => 1;

Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// 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.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModEasy : ModEasyWithExtraLives
{
public override string Description => @"More forgiving HP drain, less accuracy required, and three lives!";
public override LocalisableString Description => @"More forgiving HP drain, less accuracy required, and three lives!";
}
}
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Linq;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mania.UI;

namespace osu.Game.Rulesets.Mania.Mods
Expand All @@ -11,7 +12,7 @@ public class ManiaModFadeIn : ManiaModPlayfieldCover
{
public override string Name => "Fade In";
public override string Acronym => "FI";
public override string Description => @"Keys appear out of nowhere!";
public override LocalisableString Description => @"Keys appear out of nowhere!";
public override double ScoreMultiplier => 1;

public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ManiaModHidden)).ToArray();
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

using System;
using System.Linq;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mania.UI;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModHidden : ManiaModPlayfieldCover
{
public override string Description => @"Keys fade out before you hit them!";
public override LocalisableString Description => @"Keys fade out before you hit them!";
public override double ScoreMultiplier => 1;

public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ManiaModFadeIn)).ToArray();
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModHoldOff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Game.Rulesets.Mods;
using osu.Framework.Graphics.Sprites;
using System.Collections.Generic;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Mania.Beatmaps;

namespace osu.Game.Rulesets.Mania.Mods
Expand All @@ -20,7 +21,7 @@ public class ManiaModHoldOff : Mod, IApplicableAfterBeatmapConversion

public override double ScoreMultiplier => 1;

public override string Description => @"Replaces all hold notes with normal notes.";
public override LocalisableString Description => @"Replaces all hold notes with normal notes.";

public override IconUsage? Icon => FontAwesome.Solid.DotCircle;

Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModInvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Beatmaps;
Expand All @@ -20,7 +21,7 @@ public class ManiaModInvert : Mod, IApplicableAfterBeatmapConversion
public override string Acronym => "IN";
public override double ScoreMultiplier => 1;

public override string Description => "Hold the keys. To the beat.";
public override LocalisableString Description => "Hold the keys. To the beat.";

public override IconUsage? Icon => FontAwesome.Solid.YinYang;

Expand Down
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey1 : ManiaKeyMod
{
public override int KeyCount => 1;
public override string Name => "One Key";
public override string Acronym => "1K";
public override string Description => @"Play with one key.";
public override LocalisableString Description => @"Play with one key.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey10.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey10 : ManiaKeyMod
{
public override int KeyCount => 10;
public override string Name => "Ten Keys";
public override string Acronym => "10K";
public override string Description => @"Play with ten keys.";
public override LocalisableString Description => @"Play with ten keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey2 : ManiaKeyMod
{
public override int KeyCount => 2;
public override string Name => "Two Keys";
public override string Acronym => "2K";
public override string Description => @"Play with two keys.";
public override LocalisableString Description => @"Play with two keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey3 : ManiaKeyMod
{
public override int KeyCount => 3;
public override string Name => "Three Keys";
public override string Acronym => "3K";
public override string Description => @"Play with three keys.";
public override LocalisableString Description => @"Play with three keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey4 : ManiaKeyMod
{
public override int KeyCount => 4;
public override string Name => "Four Keys";
public override string Acronym => "4K";
public override string Description => @"Play with four keys.";
public override LocalisableString Description => @"Play with four keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey5 : ManiaKeyMod
{
public override int KeyCount => 5;
public override string Name => "Five Keys";
public override string Acronym => "5K";
public override string Description => @"Play with five keys.";
public override LocalisableString Description => @"Play with five keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey6 : ManiaKeyMod
{
public override int KeyCount => 6;
public override string Name => "Six Keys";
public override string Acronym => "6K";
public override string Description => @"Play with six keys.";
public override LocalisableString Description => @"Play with six keys.";
}
}
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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.Localisation;

namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModKey7 : ManiaKeyMod
{
public override int KeyCount => 7;
public override string Name => "Seven Keys";
public override string Acronym => "7K";
public override string Description => @"Play with seven keys.";
public override LocalisableString Description => @"Play with seven keys.";
}
}
Loading