diff --git a/osu.Game.Rulesets.Karaoke.Tests/Asserts/TimeTagAssert.cs b/osu.Game.Rulesets.Karaoke.Tests/Asserts/TimeTagAssert.cs index 1d292df95..20a4dc2d9 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Asserts/TimeTagAssert.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Asserts/TimeTagAssert.cs @@ -24,6 +24,6 @@ public static void ArePropertyEqual(TimeTag expect, TimeTag actually) AreEqual(expect.Index, actually.Index); AreEqual(expect.Time, actually.Time); AreEqual(expect.FirstSyllable, actually.FirstSyllable); - AreEqual(expect.RomanizedSyllable, actually.RomanizedSyllable); + AreEqual(expect.RomanisedSyllable, actually.RomanisedSyllable); } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandlerTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandlerTest.cs index 9b53520f0..4626aa571 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandlerTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandlerTest.cs @@ -211,7 +211,7 @@ public void TestAutoGenerateTimeTagRomaji() AssertSelectedHitObject(h => { - Assert.AreEqual("karaoke", h.TimeTags[0].RomanizedSyllable); + Assert.AreEqual("karaoke", h.TimeTags[0].RomanisedSyllable); }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandlerTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandlerTest.cs index 4374f0292..844e95b8a 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandlerTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandlerTest.cs @@ -59,7 +59,7 @@ public void TestSetTimeTagFirstSyllable() } [Test] - public void TestSetTimeTagRomanizedSyllable() + public void TestSetTimeTagRomanisedSyllable() { var timeTag = new TimeTag(new TextIndex(), 1000); PrepareHitObject(() => new Lyric @@ -71,18 +71,18 @@ public void TestSetTimeTagRomanizedSyllable() }, }); - TriggerHandlerChanged(c => c.SetTimeTagRomanizedSyllable(timeTag, "karaoke")); + TriggerHandlerChanged(c => c.SetTimeTagRomanisedSyllable(timeTag, "karaoke")); AssertSelectedHitObject(_ => { - Assert.AreEqual("karaoke", timeTag.RomanizedSyllable); + Assert.AreEqual("karaoke", timeTag.RomanisedSyllable); }); - TriggerHandlerChanged(c => c.SetTimeTagRomanizedSyllable(timeTag, " ")); + TriggerHandlerChanged(c => c.SetTimeTagRomanisedSyllable(timeTag, " ")); AssertSelectedHitObject(_ => { - Assert.AreEqual(string.Empty, timeTag.RomanizedSyllable); + Assert.AreEqual(string.Empty, timeTag.RomanisedSyllable); }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTimeTagTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTimeTagTest.cs index b789cacc7..f9531ef3f 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTimeTagTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTimeTagTest.cs @@ -105,7 +105,7 @@ public void TestCheckEmptyTime(string text, string[] timeTags) [TestCase("カラオケ", "")] // should not be empty. [TestCase("カラオケ", " ")] // should not be white-space only. [TestCase("カラオケ", "卡拉OK")] // should be within latin. - public void TestCheckTimeTagRomajiInvalidText(string text, string romanizedSyllable) + public void TestCheckTimeTagRomajiInvalidText(string text, string romanisedSyllable) { var lyric = new Lyric { @@ -114,7 +114,7 @@ public void TestCheckTimeTagRomajiInvalidText(string text, string romanizedSylla { new TimeTag(new TextIndex()) { - RomanizedSyllable = romanizedSyllable, + RomanisedSyllable = romanisedSyllable, Time = 1000, }, new TimeTag(new TextIndex(3, TextIndex.IndexState.End)) @@ -128,7 +128,7 @@ public void TestCheckTimeTagRomajiInvalidText(string text, string romanizedSylla } [TestCase("カラオケ", null)] // should not be white-space only. - public void TestCheckRomajiEmptyTextIfFirst(string text, string romanizedSyllable) + public void TestCheckRomajiEmptyTextIfFirst(string text, string romanisedSyllable) { var lyric = new Lyric { @@ -137,7 +137,7 @@ public void TestCheckRomajiEmptyTextIfFirst(string text, string romanizedSyllabl { new TimeTag(new TextIndex()) { - RomanizedSyllable = romanizedSyllable, + RomanisedSyllable = romanisedSyllable, FirstSyllable = true, Time = 1000, }, @@ -154,7 +154,7 @@ public void TestCheckRomajiEmptyTextIfFirst(string text, string romanizedSyllabl [TestCase("カラオケ", "")] // should not have empty text if end. [TestCase("カラオケ", " ")] // should not have empty text if end. [TestCase("カラオケ", "123")] // should not have empty text if end. - public void TestRomajiNotHaveEmptyTextIfEnd(string text, string romanizedSyllable) + public void TestRomajiNotHaveEmptyTextIfEnd(string text, string romanisedSyllable) { var lyric = new Lyric { @@ -167,7 +167,7 @@ public void TestRomajiNotHaveEmptyTextIfEnd(string text, string romanizedSyllabl }, new TimeTag(new TextIndex(3, TextIndex.IndexState.End)) { - RomanizedSyllable = romanizedSyllable, + RomanisedSyllable = romanisedSyllable, Time = 2000, }, }, diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/BaseRomanizationGeneratorTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/BaseRomanisationGeneratorTest.cs similarity index 57% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/BaseRomanizationGeneratorTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/BaseRomanisationGeneratorTest.cs index 319e013cf..11906e5b1 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/BaseRomanizationGeneratorTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/BaseRomanisationGeneratorTest.cs @@ -4,22 +4,22 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Tests.Asserts; -namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanisation; -public abstract class BaseRomanizationGeneratorTest : BaseLyricGeneratorTest, TConfig> - where TRomanizationGenerator : RomanizationGenerator where TConfig : RomanizationGeneratorConfig, new() +public abstract class BaseRomanisationGeneratorTest : BaseLyricGeneratorTest, TConfig> + where TRomanisationGenerator : RomanisationGenerator where TConfig : RomanisationGeneratorConfig, new() { protected void CheckGenerateResult(Lyric lyric, string[] expectedRubies, TConfig config) { - var expected = RomanizationGenerateResultHelper.ParseRomanizationGenerateResults(lyric.TimeTags, expectedRubies); + var expected = RomanisationGenerateResultHelper.ParseRomanisationGenerateResults(lyric.TimeTags, expectedRubies); CheckGenerateResult(lyric, expected, config); } - protected override void AssertEqual(IReadOnlyDictionary expected, IReadOnlyDictionary actual) + protected override void AssertEqual(IReadOnlyDictionary expected, IReadOnlyDictionary actual) { TimeTagAssert.ArePropertyEqual(expected.Select(x => x.Key).ToArray(), actual.Select(x => x.Key).ToArray()); Assert.AreEqual(expected.Select(x => x.Value), actual.Select(x => x.Value)); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorTest.cs similarity index 74% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorTest.cs index 7f30bcca6..d70043330 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorTest.cs @@ -4,19 +4,19 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization.Ja; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation.Ja; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Tests.Helper; -namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanization.Ja; +namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanisation.Ja; -public class JaRomanizationGeneratorTest : BaseRomanizationGeneratorTest +public class JaRomanisationGeneratorTest : BaseRomanisationGeneratorTest { [TestCase("花火大会", new[] { "[0,start]", "[3,end]" }, true)] [TestCase("花火大会", new[] { "[0,start]" }, true)] [TestCase("花火大会", new[] { "[3,end]" }, false)] // not able to generate the has no start time-tag. - [TestCase("花火大会", new string[] { }, false)] // not able to make the romanization if has no time-tag. - [TestCase("", new string[] { }, false)] // not able to make the romanization if lyric is empty. + [TestCase("花火大会", new string[] { }, false)] // not able to make the romanisation if has no time-tag. + [TestCase("", new string[] { }, false)] // not able to make the romanisation if lyric is empty. [TestCase(" ", new string[] { }, false)] [TestCase(null, new string[] { }, false)] public void TestCanGenerate(string text, string[] timeTagStrings, bool canGenerate) @@ -40,7 +40,7 @@ public void TestCanGenerate(string text, string[] timeTagStrings, bool canGenera [TestCase("枯れた世界に輝く", new[] { "[0,start]", "[1,start]", "[2,start]", "[3,start]", "[4,start]", "[5,start]", "[6,start]", "[6,start]", "[6,start]", "[7,start]", "[7,end]" }, new[] { "^kare", "", "ta", "sekai", "", "ni", "kagayaku", "", "", "", "" })] - public void TestGenerate(string text, string[] timeTagStrings, string[] expectedRomanizedSyllables) + public void TestGenerate(string text, string[] timeTagStrings, string[] expectedRomanisedSyllables) { var config = GeneratorEmptyConfig(); @@ -51,12 +51,12 @@ public void TestGenerate(string text, string[] timeTagStrings, string[] expected TimeTags = timeTags, }; - CheckGenerateResult(lyric, expectedRomanizedSyllables, config); + CheckGenerateResult(lyric, expectedRomanisedSyllables, config); } [TestCase("はなび", new[] { "[0,start]" }, new[] { "^HANA BI" })] [TestCase("花火大会", new[] { "[0,start]", "[2,start]", "[3,end]" }, new[] { "^HANABI", "TAIKAI", "" })] - public void TestGenerateWithUppercase(string text, string[] timeTagStrings, string[] expectedRomanizedSyllables) + public void TestGenerateWithUppercase(string text, string[] timeTagStrings, string[] expectedRomanisedSyllables) { var config = GeneratorEmptyConfig(x => x.Uppercase.Value = true); @@ -67,7 +67,7 @@ public void TestGenerateWithUppercase(string text, string[] timeTagStrings, stri TimeTags = timeTags, }; - CheckGenerateResult(lyric, expectedRomanizedSyllables, config); + CheckGenerateResult(lyric, expectedRomanisedSyllables, config); } [TestCase("花", new[] { "[0,start]", "[0,end]" }, new[] { "[0]:hana" }, new[] { "^hana", "" })] @@ -75,13 +75,13 @@ public void TestGenerateWithUppercase(string text, string[] timeTagStrings, stri [TestCase("花火", new[] { "[0,start]", "[1,start]", "[1,end]" }, new[] { "[0]:hana", "[1]:bi" }, new[] { "^hana", "bi", "" })] [TestCase("花火", new[] { "[0,start]", "[0,start]", "[1,start]", "[1,end]" }, new[] { "[0]:hana", "[1]:bi" }, new[] { "^hana", "", "bi", "" })] [TestCase("はなび", new[] { "[0,start]", "[1,start]", "[2,start]", "[2,end]" }, new[] { "[0]:hana", "[2]:bi" }, new[] { "^hana", "", "bi", "" })] - public void TestConvertToRomanizationGenerateResult(string text, string[] timeTagStrings, string[] romanizationParams, string[] expectedResults) + public void TestConvertToRomanisationGenerateResult(string text, string[] timeTagStrings, string[] romanisationParams, string[] expectedResults) { var timeTags = TestCaseTagHelper.ParseTimeTags(timeTagStrings); - var romanizations = parseRomanizationGenerateResults(romanizationParams); + var results = parseRomanisationGenerateResults(romanisationParams); - var expected = RomanizationGenerateResultHelper.ParseRomanizationGenerateResults(timeTags, expectedResults); - var actual = JaRomanizationGenerator.Convert(timeTags, romanizations); + var expected = RomanisationGenerateResultHelper.ParseRomanisationGenerateResults(timeTags, expectedResults); + var actual = JaRomanisationGenerator.Convert(timeTags, results); AssertEqual(expected, actual); } @@ -90,19 +90,19 @@ public void TestConvertToRomanizationGenerateResult(string text, string[] timeTa /// Process test case time tag string format into /// /// Time tag string format - /// Time tag object - private static JaRomanizationGenerator.RomanizationGeneratorParameter parseRomanizationGenerateResult(string str) + /// Time tag object + private static JaRomanisationGenerator.RomanisationGeneratorParameter parseRomanisationGenerateResult(string str) { // because format is same as the text-tag testing format, so just use this helper. var romajiTag = TestCaseTagHelper.ParseRomajiTag(str); - return new JaRomanizationGenerator.RomanizationGeneratorParameter + return new JaRomanisationGenerator.RomanisationGeneratorParameter { StartIndex = romajiTag.StartIndex, EndIndex = romajiTag.EndIndex, - RomanizedSyllable = romajiTag.Text, + RomanisedSyllable = romajiTag.Text, }; } - private static JaRomanizationGenerator.RomanizationGeneratorParameter[] parseRomanizationGenerateResults(IEnumerable strings) - => strings.Select(parseRomanizationGenerateResult).ToArray(); + private static JaRomanisationGenerator.RomanisationGeneratorParameter[] parseRomanisationGenerateResults(IEnumerable strings) + => strings.Select(parseRomanisationGenerateResult).ToArray(); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGenerateResultHelper.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGenerateResultHelper.cs similarity index 53% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGenerateResultHelper.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGenerateResultHelper.cs index 669e5c0d3..9b186c53d 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGenerateResultHelper.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGenerateResultHelper.cs @@ -4,15 +4,15 @@ using System; using System.Collections.Generic; using System.Linq; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; using osu.Game.Rulesets.Karaoke.Objects; -namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanisation; -public class RomanizationGenerateResultHelper +public class RomanisationGenerateResultHelper { /// - /// Convert the string format into the . + /// Convert the string format into the . /// /// /// karaoke @@ -20,30 +20,30 @@ public class RomanizationGenerateResultHelper /// /// Origin time-tag /// Generate result string format - /// Romanization generate result. - public static KeyValuePair ParseRomanizationGenerateResult(TimeTag timeTag, string str) + /// Romanisation generate result. + public static KeyValuePair ParseRomanisationGenerateResult(TimeTag timeTag, string str) { - var result = new RomanizationGenerateResult + var result = new RomanisationGenerateResult { FirstSyllable = str.StartsWith("^", StringComparison.Ordinal), - RomanizedSyllable = str.Replace("^", ""), + RomanisedSyllable = str.Replace("^", ""), }; - return new KeyValuePair(timeTag, result); + return new KeyValuePair(timeTag, result); } - public static IReadOnlyDictionary ParseRomanizationGenerateResults(IList timeTags, IList strings) + public static IReadOnlyDictionary ParseRomanisationGenerateResults(IList timeTags, IList strings) { if (timeTags.Count != strings.Count) throw new InvalidOperationException(); - return parseRomanizationGenerateResults(timeTags, strings).ToDictionary(k => k.Key, v => v.Value); + return parseRomanisationGenerateResults(timeTags, strings).ToDictionary(k => k.Key, v => v.Value); - static IEnumerable> parseRomanizationGenerateResults(IList timeTags, IList strings) + static IEnumerable> parseRomanisationGenerateResults(IList timeTags, IList strings) { for (int i = 0; i < timeTags.Count; i++) { - yield return ParseRomanizationGenerateResult(timeTags[i], strings[i]); + yield return ParseRomanisationGenerateResult(timeTags[i], strings[i]); } } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGeneratorSelectorTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGeneratorSelectorTest.cs similarity index 79% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGeneratorSelectorTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGeneratorSelectorTest.cs index 75f05a522..cc2552f12 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanization/RomanizationGeneratorSelectorTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Generator/Lyrics/Romanisation/RomanisationGeneratorSelectorTest.cs @@ -6,18 +6,18 @@ using System.Linq; using NUnit.Framework; using osu.Framework.Graphics.Sprites; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Tests.Asserts; using osu.Game.Rulesets.Karaoke.Tests.Helper; -namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Generator.Lyrics.Romanisation; -public class RomanizationGeneratorSelectorTest : BaseLyricGeneratorSelectorTest> +public class RomanisationGeneratorSelectorTest : BaseLyricGeneratorSelectorTest> { [TestCase(17, "花火大会", true)] [TestCase(17, "我是中文", true)] // only change the language code to decide should be able to generate or not. - [TestCase(17, "", false)] // will not able to make the romanization if lyric is empty. + [TestCase(17, "", false)] // will not able to make the romanisation if lyric is empty. [TestCase(17, " ", false)] [TestCase(17, null, false)] [TestCase(1028, "はなび", false)] // Should not be able to generate if language is not supported. @@ -39,7 +39,7 @@ public void TestCanGenerate(int lcid, string text, bool canGenerate) [TestCase(17, "はなび", new[] { "[0,start]" }, new[] { "^hana bi" })] // Japanese [TestCase(1041, "花火大会", new[] { "[0,start]", "[3,end]" }, new[] { "^hanabi taikai", "" })] // Japanese - public void TestGenerate(int lcid, string text, string[] timeTagStrings, string[] expectedRomanizedSyllables) + public void TestGenerate(int lcid, string text, string[] timeTagStrings, string[] expectedRomanisedSyllables) { var selector = CreateSelector(); @@ -51,11 +51,11 @@ public void TestGenerate(int lcid, string text, string[] timeTagStrings, string[ TimeTags = timeTags, }; - var expected = RomanizationGenerateResultHelper.ParseRomanizationGenerateResults(timeTags, expectedRomanizedSyllables); + var expected = RomanisationGenerateResultHelper.ParseRomanisationGenerateResults(timeTags, expectedRomanisedSyllables); CheckGenerateResult(lyric, expected, selector); } - protected override void AssertEqual(IReadOnlyDictionary expected, IReadOnlyDictionary actual) + protected override void AssertEqual(IReadOnlyDictionary expected, IReadOnlyDictionary actual) { TimeTagAssert.ArePropertyEqual(expected.Select(x => x.Key).ToArray(), actual.Select(x => x.Key).ToArray()); Assert.AreEqual(expected.Select(x => x.Value), actual.Select(x => x.Value)); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/DisplayLyricProcessorTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/DisplayLyricProcessorTest.cs index d09c9486e..079ba692c 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/DisplayLyricProcessorTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/DisplayLyricProcessorTest.cs @@ -76,7 +76,7 @@ public void TestTextChanged() public void TestSwitchDisplayType() { // change the display type. - testProcessor!.DisplayType = LyricDisplayType.RomanizedSyllable; + testProcessor!.DisplayType = LyricDisplayType.RomanisedSyllable; // check the changed count Assert.AreEqual(topTextChangeCount, 1); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneDisplayProcessor.cs b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneDisplayProcessor.cs index 6ae26706e..b33329b98 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneDisplayProcessor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneDisplayProcessor.cs @@ -83,7 +83,7 @@ public void TestDisplayProperty([Values] LyricDisplayProperty property) lyric.Text = "カラオケ"; break; - case RomanizedSyllableFirstDisplayProcessor: + case RomanisedSyllableFirstDisplayProcessor: lyric.TimeTags = TestCaseTagHelper.ParseTimeTags(new[] { "[0,start]:1000#^ka", "[1,start]:2000#ra", "[2,start]:3000#o", "[3,start]:4000#ke", "[3,end]:5000" }); break; diff --git a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneLyricFirstDisplayProcessor.cs b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneLyricFirstDisplayProcessor.cs index 75e9475c8..6d77dc7cd 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneLyricFirstDisplayProcessor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneLyricFirstDisplayProcessor.cs @@ -130,7 +130,7 @@ public void TestTimeTagsChangedWithEmptyText() AssertTopTextNotChanged(); AssertCenterTextNotChanged(); - // it's OK not to filter the romanization that out of range. karaoke/sprite text will not display that. + // it's OK not to filter the romanisation that out of range. karaoke/sprite text will not display that. AssertBottomTextChanged(new PositionText[] { new("ka", 0, 0), diff --git a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanizedSyllableFirstDisplayProcessor.cs b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanisedSyllableFirstDisplayProcessor.cs similarity index 96% rename from osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanizedSyllableFirstDisplayProcessor.cs rename to osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanisedSyllableFirstDisplayProcessor.cs index 38c134df1..1d6bac693 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanizedSyllableFirstDisplayProcessor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Graphics/Sprites/Processor/TestSceneRomanisedSyllableFirstDisplayProcessor.cs @@ -12,10 +12,10 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Graphics.Sprites.Processor; -public partial class TestSceneRomanizedSyllableFirstDisplayProcessor : TestSceneDisplayProcessor +public partial class TestSceneRomanisedSyllableFirstDisplayProcessor : TestSceneDisplayProcessor { protected override BaseDisplayProcessor CreateProcessor(Lyric lyric, LyricDisplayProperty displayProperty) - => new RomanizedSyllableFirstDisplayProcessor(lyric, displayProperty); + => new RomanisedSyllableFirstDisplayProcessor(lyric, displayProperty); #region Happy path diff --git a/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseTagHelper.cs b/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseTagHelper.cs index 5503b8995..7bd80d723 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseTagHelper.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseTagHelper.cs @@ -129,9 +129,9 @@ public static RomajiTag ParseRomajiTag(string? str) /// [0,start]:1000 -> has time-tag index with time.
/// [0,start] -> has time-tag index with no time.
/// [0,start]: -> has time-tag index with no time.
- /// [0,start]#karaoke -> has time-tag index with romanized syllable.
- /// [0,start]#^karaoke -> has time-tag index with romanized syllable, and it's the first one.
- /// [0,start]:1000#karaoke -> has time-tag index with time and romanized syllable.
+ /// [0,start]#karaoke -> has time-tag index with romanised syllable.
+ /// [0,start]#^karaoke -> has time-tag index with romanised syllable, and it's the first one.
+ /// [0,start]:1000#karaoke -> has time-tag index with time and romanised syllable.
/// /// Time tag string format /// Time tag object @@ -157,7 +157,7 @@ public static TimeTag ParseTimeTag(string? str) return new TimeTag(new TextIndex(index, state), time) { FirstSyllable = firstSyllable ?? default, - RomanizedSyllable = text?.Replace("^", ""), + RomanisedSyllable = text?.Replace("^", ""), }; }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Objects/TimeTagTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Objects/TimeTagTest.cs index 3221fdc40..7ea723200 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Objects/TimeTagTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Objects/TimeTagTest.cs @@ -15,7 +15,7 @@ public void TestClone() var timeTag = new TimeTag(new TextIndex(1, TextIndex.IndexState.End), 1000) { FirstSyllable = true, - RomanizedSyllable = "karaoke", + RomanisedSyllable = "karaoke", }; var clonedTimeTag = timeTag.DeepClone(); @@ -25,6 +25,6 @@ public void TestClone() Assert.AreNotSame(clonedTimeTag.TimeBindable, timeTag.TimeBindable); Assert.AreEqual(clonedTimeTag.Time, timeTag.Time); Assert.AreNotSame(clonedTimeTag.FirstSyllable, timeTag.FirstSyllable); - Assert.AreEqual(clonedTimeTag.RomanizedSyllable, timeTag.RomanizedSyllable); + Assert.AreEqual(clonedTimeTag.RomanisedSyllable, timeTag.RomanisedSyllable); } } diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditGeneratorConfigManager.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditGeneratorConfigManager.cs index ad4e9753a..b7508299f 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditGeneratorConfigManager.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditGeneratorConfigManager.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Language; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Notes; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.ReferenceLyric; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization.Ja; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation.Ja; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.RubyTags.Ja; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.TimeTags.Ja; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.TimeTags.Zh; @@ -50,7 +50,7 @@ protected override void InitialiseDefaults() SetDefault(); // Romaji generator - SetDefault(); + SetDefault(); // Note generator SetDefault(); @@ -79,7 +79,7 @@ protected static KaraokeRulesetEditGeneratorSetting GetSettingByType() = Type t when t == typeof(JaRubyTagGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.JaRubyTagGeneratorConfig, Type t when t == typeof(JaTimeTagGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.JaTimeTagGeneratorConfig, Type t when t == typeof(ZhTimeTagGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.ZhTimeTagGeneratorConfig, - Type t when t == typeof(JaRomanizationGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.JaRomajiGeneratorConfig, + Type t when t == typeof(JaRomanisationGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.JaRomajiGeneratorConfig, Type t when t == typeof(NoteGeneratorConfig) => KaraokeRulesetEditGeneratorSetting.NoteGeneratorConfig, _ => throw new NotSupportedException(), }; diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTimeTagsChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTimeTagsChangeHandler.cs index 76b7f7ca0..9a65fc9aa 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTimeTagsChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTimeTagsChangeHandler.cs @@ -13,7 +13,7 @@ public interface ILyricTimeTagsChangeHandler : ILyricListPropertyChangeHandler timeTags, double offset); diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandler.cs index 3069f5152..c4abe696e 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricPropertyAutoGenerateChangeHandler.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Language; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Notes; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.ReferenceLyric; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.RubyTags; using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.TimeTags; using osu.Game.Rulesets.Karaoke.Edit.Utils; @@ -55,7 +55,7 @@ public bool CanGenerate(AutoGenerateType type) return canGenerate(timeTagGenerator); case AutoGenerateType.AutoGenerateTimeTagRomaji: - var timeTagRomajiGenerator = getSelector, RomanizationGeneratorConfig>(); + var timeTagRomajiGenerator = getSelector, RomanisationGeneratorConfig>(); return canGenerate(timeTagRomajiGenerator); case AutoGenerateType.AutoGenerateNotes: @@ -96,7 +96,7 @@ public IDictionary GetGeneratorNotSupportedLyrics(Auto return getInvalidMessageFromGenerator(timeTagGenerator); case AutoGenerateType.AutoGenerateTimeTagRomaji: - var timeTagRomajiGenerator = getSelector, RomanizationGeneratorConfig>(); + var timeTagRomajiGenerator = getSelector, RomanisationGeneratorConfig>(); return getInvalidMessageFromGenerator(timeTagRomajiGenerator); case AutoGenerateType.AutoGenerateNotes: @@ -171,7 +171,7 @@ public void AutoGenerate(AutoGenerateType type) break; case AutoGenerateType.AutoGenerateTimeTagRomaji: - var timeTagRomajiGenerator = getSelector, RomanizationGeneratorConfig>(); + var timeTagRomajiGenerator = getSelector, RomanisationGeneratorConfig>(); PerformOnSelection(lyric => { var results = timeTagRomajiGenerator.Generate(lyric); @@ -180,7 +180,7 @@ public void AutoGenerate(AutoGenerateType type) { var matchedTimeTag = lyric.TimeTags.Single(x => x == key); matchedTimeTag.FirstSyllable = value.FirstSyllable; - matchedTimeTag.RomanizedSyllable = value.RomanizedSyllable; + matchedTimeTag.RomanisedSyllable = value.RomanisedSyllable; } }); break; diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandler.cs index 8b298ee39..423994728 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTimeTagsChangeHandler.cs @@ -41,7 +41,7 @@ public void SetTimeTagFirstSyllable(TimeTag timeTag, bool firstSyllable) }); } - public void SetTimeTagRomanizedSyllable(TimeTag timeTag, string? romanizedSyllable) + public void SetTimeTagRomanisedSyllable(TimeTag timeTag, string? romanisedSyllable) { CheckExactlySelectedOneHitObject(); @@ -51,12 +51,12 @@ public void SetTimeTagRomanizedSyllable(TimeTag timeTag, string? romanizedSyllab if (!containsInLyric) throw new InvalidOperationException($"{nameof(timeTag)} is not in the lyric"); - timeTag.RomanizedSyllable = romanizedSyllable; + timeTag.RomanisedSyllable = romanisedSyllable; - if (!string.IsNullOrWhiteSpace(romanizedSyllable)) + if (!string.IsNullOrWhiteSpace(romanisedSyllable)) return; - timeTag.RomanizedSyllable = string.Empty; + timeTag.RomanisedSyllable = string.Empty; timeTag.FirstSyllable = false; }); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTimeTag.cs b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTimeTag.cs index 528212106..190b1be12 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTimeTag.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTimeTag.cs @@ -35,7 +35,7 @@ protected override IEnumerable Check(Lyric lyric) { var issues = new List(); issues.AddRange(CheckTimeTag(lyric)); - issues.AddRange(CheckTimeTagRomanizedSyllable(lyric)); + issues.AddRange(CheckTimeTagRomanisedSyllable(lyric)); return issues; } @@ -78,7 +78,7 @@ protected IEnumerable CheckTimeTag(Lyric lyric) } } - protected IEnumerable CheckTimeTagRomanizedSyllable(Lyric lyric) + protected IEnumerable CheckTimeTagRomanisedSyllable(Lyric lyric) { if (!lyric.TimeTags.Any()) { @@ -88,23 +88,23 @@ protected IEnumerable CheckTimeTagRomanizedSyllable(Lyric lyric) foreach (var timeTag in lyric.TimeTags) { bool firstSyllable = timeTag.FirstSyllable; - string? romanizedSyllable = timeTag.RomanizedSyllable; + string? romanisedSyllable = timeTag.RomanisedSyllable; switch (timeTag.Index.State) { case TextIndex.IndexState.Start: - // if input the romanized syllable, should be valid. - if (romanizedSyllable != null && !isRomanizedSyllableValid(romanizedSyllable)) + // if input the romanised syllable, should be valid. + if (romanisedSyllable != null && !isRomanisedSyllableValid(romanisedSyllable)) yield return new IssueTemplateLyricTimeTagRomajiInvalidText(this).Create(lyric, timeTag); - // if is first romanized syllable, should not be null. - if (firstSyllable && romanizedSyllable == null) + // if is first romanised syllable, should not be null. + if (firstSyllable && romanisedSyllable == null) yield return new IssueTemplateLyricTimeTagRomajiInvalidTextIfFirst(this).Create(lyric, timeTag); break; case TextIndex.IndexState.End: - if (romanizedSyllable != null) + if (romanisedSyllable != null) yield return new IssueTemplateLyricTimeTagRomajiNotHaveEmptyTextIfEnd(this).Create(lyric, timeTag); if (firstSyllable) @@ -119,7 +119,7 @@ protected IEnumerable CheckTimeTagRomanizedSyllable(Lyric lyric) yield break; - static bool isRomanizedSyllableValid(string text) + static bool isRomanisedSyllableValid(string text) { // should not be white-space only. if (string.IsNullOrWhiteSpace(text)) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGenerator.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGenerator.cs similarity index 64% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGenerator.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGenerator.cs index e6d9ca096..ba42656a8 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGenerator.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGenerator.cs @@ -13,13 +13,13 @@ using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Utils; -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization.Ja; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation.Ja; -public class JaRomanizationGenerator : RomanizationGenerator +public class JaRomanisationGenerator : RomanisationGenerator { private readonly Analyzer analyzer; - public JaRomanizationGenerator(JaRomanizationGeneratorConfig config) + public JaRomanisationGenerator(JaRomanisationGeneratorConfig config) : base(config) { analyzer = Analyzer.NewAnonymous((fieldName, reader) => @@ -29,20 +29,20 @@ public JaRomanizationGenerator(JaRomanizationGeneratorConfig config) }); } - protected override IReadOnlyDictionary GenerateFromItem(Lyric item) + protected override IReadOnlyDictionary GenerateFromItem(Lyric item) { // Tokenize the text string text = item.Text; var tokenStream = analyzer.GetTokenStream("dummy", new StringReader(text)); // get the processing tags. - var processingRomanizations = getProcessingRomanizations(text, tokenStream, Config).ToArray(); + var parameters = generateParameters(text, tokenStream, Config).ToArray(); // then, trying to mapping them with the time-tags. - return Convert(item.TimeTags, processingRomanizations); + return Convert(item.TimeTags, parameters); } - private static IEnumerable getProcessingRomanizations(string text, TokenStream tokenStream, JaRomanizationGeneratorConfig config) + private static IEnumerable generateParameters(string text, TokenStream tokenStream, JaRomanisationGeneratorConfig config) { // Reset the stream and convert all result tokenStream.Reset(); @@ -65,18 +65,18 @@ private static IEnumerable getProcessingRomaniza string parentText = text[offsetAttribute.StartOffset..offsetAttribute.EndOffset]; bool fromKanji = JpStringUtils.ToKatakana(katakana) != JpStringUtils.ToKatakana(parentText); - // Convert to romanized syllable. - string romanizedSyllable = JpStringUtils.ToRomaji(katakana); + // Convert to romanised syllable. + string romanisedSyllable = JpStringUtils.ToRomaji(katakana); if (config.Uppercase.Value) - romanizedSyllable = romanizedSyllable.ToUpper(); + romanisedSyllable = romanisedSyllable.ToUpper(); // Make tag - yield return new RomanizationGeneratorParameter + yield return new RomanisationGeneratorParameter { FromKanji = fromKanji, StartIndex = offsetAttribute.StartOffset, EndIndex = offsetAttribute.EndOffset - 1, - RomanizedSyllable = romanizedSyllable, + RomanisedSyllable = romanisedSyllable, }; } @@ -85,58 +85,58 @@ private static IEnumerable getProcessingRomaniza tokenStream.Dispose(); } - internal static IReadOnlyDictionary Convert(IList timeTags, IList romanizations) + internal static IReadOnlyDictionary Convert(IList timeTags, IList parameters) { - var group = createGroup(timeTags, romanizations); + var group = createGroup(timeTags, parameters); return group.ToDictionary(k => k.Key, x => { bool isFirst = timeTags.IndexOf(x.Key) == 0; // todo: use better to mark the first syllable. - string romanizedSyllable = string.Join(" ", x.Value.Select(r => r.RomanizedSyllable)); + string romanisedSyllable = string.Join(" ", x.Value.Select(r => r.RomanisedSyllable)); - return new RomanizationGenerateResult + return new RomanisationGenerateResult { FirstSyllable = isFirst, - RomanizedSyllable = romanizedSyllable, + RomanisedSyllable = romanisedSyllable, }; }); - static IReadOnlyDictionary> createGroup(IList timeTags, IList romanizations) + static IReadOnlyDictionary> createGroup(IList timeTags, IList parameters) { - var dictionary = timeTags.ToDictionary(x => x, v => new List()); + var dictionary = timeTags.ToDictionary(x => x, v => new List()); int processedIndex = 0; foreach (var (timeTag, list) in dictionary) { - while (processedIndex < romanizations.Count && isTimeTagInRange(timeTags, timeTag, romanizations[processedIndex])) + while (processedIndex < parameters.Count && isTimeTagInRange(timeTags, timeTag, parameters[processedIndex])) { - list.Add(romanizations[processedIndex]); + list.Add(parameters[processedIndex]); processedIndex++; } } - if (processedIndex < romanizations.Count - 1) - throw new InvalidOperationException("Still have romanizations that haven't process"); + if (processedIndex < parameters.Count - 1) + throw new InvalidOperationException("Still have romanisations that haven't process"); return dictionary; } - static bool isTimeTagInRange(IEnumerable timeTags, TimeTag currentTimeTag, RomanizationGeneratorParameter parameter) + static bool isTimeTagInRange(IEnumerable timeTags, TimeTag currentTimeTag, RomanisationGeneratorParameter parameter) { if (currentTimeTag.Index.State == TextIndex.IndexState.End) return false; - int romanizationIndex = parameter.StartIndex; + int romanisationIndex = parameter.StartIndex; var nextTimeTag = timeTags.GetNextMatch(currentTimeTag, x => x.Index > currentTimeTag.Index && x.Index.State == TextIndex.IndexState.Start); if (nextTimeTag == null) - return romanizationIndex >= currentTimeTag.Index.Index; + return romanisationIndex >= currentTimeTag.Index.Index; - return romanizationIndex >= currentTimeTag.Index.Index && romanizationIndex < nextTimeTag.Index.Index; + return romanisationIndex >= currentTimeTag.Index.Index && romanisationIndex < nextTimeTag.Index.Index; } } - internal class RomanizationGeneratorParameter + internal class RomanisationGeneratorParameter { public bool FromKanji { get; set; } @@ -144,6 +144,6 @@ internal class RomanizationGeneratorParameter public int EndIndex { get; set; } - public string RomanizedSyllable { get; set; } = string.Empty; + public string RomanisedSyllable { get; set; } = string.Empty; } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorConfig.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorConfig.cs similarity index 71% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorConfig.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorConfig.cs index 464a4e2ee..9a71b644d 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/Ja/JaRomanizationGeneratorConfig.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/Ja/JaRomanisationGeneratorConfig.cs @@ -3,10 +3,10 @@ using osu.Framework.Bindables; -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization.Ja; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation.Ja; -public class JaRomanizationGeneratorConfig : RomanizationGeneratorConfig +public class JaRomanisationGeneratorConfig : RomanisationGeneratorConfig { - [ConfigSource("Uppercase", "Export romanization with uppercase.")] + [ConfigSource("Uppercase", "Export romanisation with uppercase.")] public Bindable Uppercase { get; } = new BindableBool(); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerateResult.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerateResult.cs similarity index 72% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerateResult.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerateResult.cs index 53eb8bb1f..c0418a6bb 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerateResult.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerateResult.cs @@ -1,11 +1,11 @@ // Copyright (c) andy840119 . Licensed under the GPL Licence. // See the LICENCE file in the repository root for full licence text. -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; -public struct RomanizationGenerateResult +public struct RomanisationGenerateResult { public bool FirstSyllable { get; set; } - public string? RomanizedSyllable { get; set; } + public string? RomanisedSyllable { get; set; } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerator.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerator.cs similarity index 77% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerator.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerator.cs index c47eef0a5..208194bf8 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGenerator.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGenerator.cs @@ -7,12 +7,12 @@ using osu.Framework.Localisation; using osu.Game.Rulesets.Karaoke.Objects; -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; -public abstract class RomanizationGenerator : LyricPropertyGenerator, TConfig> - where TConfig : RomanizationGeneratorConfig, new() +public abstract class RomanisationGenerator : LyricPropertyGenerator, TConfig> + where TConfig : RomanisationGeneratorConfig, new() { - protected RomanizationGenerator(TConfig config) + protected RomanisationGenerator(TConfig config) : base(config) { } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorConfig.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorConfig.cs similarity index 76% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorConfig.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorConfig.cs index f6e594d77..8bc308ec7 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorConfig.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorConfig.cs @@ -1,8 +1,8 @@ // Copyright (c) andy840119 . Licensed under the GPL Licence. // See the LICENCE file in the repository root for full licence text. -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; -public abstract class RomanizationGeneratorConfig : GeneratorConfig +public abstract class RomanisationGeneratorConfig : GeneratorConfig { } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorSelector.cs b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorSelector.cs similarity index 57% rename from osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorSelector.cs rename to osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorSelector.cs index a13729c2b..00a5a70f1 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanization/RomanizationGeneratorSelector.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Generator/Lyrics/Romanisation/RomanisationGeneratorSelector.cs @@ -4,17 +4,17 @@ using System.Collections.Generic; using System.Globalization; using osu.Game.Rulesets.Karaoke.Configuration; -using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization.Ja; +using osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation.Ja; using osu.Game.Rulesets.Karaoke.Objects; -namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanization; +namespace osu.Game.Rulesets.Karaoke.Edit.Generator.Lyrics.Romanisation; -public class RomanizationGeneratorSelector : LyricGeneratorSelector, RomanizationGeneratorConfig> +public class RomanisationGeneratorSelector : LyricGeneratorSelector, RomanisationGeneratorConfig> { - public RomanizationGeneratorSelector(KaraokeRulesetEditGeneratorConfigManager generatorConfigManager) + public RomanisationGeneratorSelector(KaraokeRulesetEditGeneratorConfigManager generatorConfigManager) : base(generatorConfigManager) { - RegisterGenerator(new CultureInfo(17)); - RegisterGenerator(new CultureInfo(1041)); + RegisterGenerator(new CultureInfo(17)); + RegisterGenerator(new CultureInfo(1041)); } } diff --git a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/DisplayLyricProcessor.cs b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/DisplayLyricProcessor.cs index d427dc89a..2e4c9e7b1 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/DisplayLyricProcessor.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/DisplayLyricProcessor.cs @@ -64,7 +64,7 @@ private void reloadProcessor() processor = DisplayType switch { LyricDisplayType.Lyric => new LyricFirstDisplayProcessor(lyric, DisplayProperty), - LyricDisplayType.RomanizedSyllable => new RomanizedSyllableFirstDisplayProcessor(lyric, DisplayProperty), + LyricDisplayType.RomanisedSyllable => new RomanisedSyllableFirstDisplayProcessor(lyric, DisplayProperty), _ => throw new ArgumentOutOfRangeException(), }; diff --git a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayProperty.cs b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayProperty.cs index e9e467abd..5ed3a0ac1 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayProperty.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayProperty.cs @@ -21,8 +21,8 @@ public enum LyricDisplayProperty /// Display bottom text. /// /// - /// Display the as bottom text if .
- /// Display the as bottom text if .
+ /// Display the as bottom text if .
+ /// Display the as bottom text if .
///
BottomText = 1 << 2, diff --git a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayType.cs b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayType.cs index 538596697..0dacf1b83 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayType.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/LyricDisplayType.cs @@ -13,17 +13,17 @@ public enum LyricDisplayType /// /// Top:
/// Center:
- /// Bottom:
+ /// Bottom:
///
Lyric, /// - /// Display the romanized lyric as center of the text. + /// Display the romanised lyric as center of the text. /// /// /// Top:
- /// Center:
+ /// Center:
/// Bottom:
///
- RomanizedSyllable, + RomanisedSyllable, } diff --git a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/LyricFirstDisplayProcessor.cs b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/LyricFirstDisplayProcessor.cs index 450b38c23..a5a8835e8 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/LyricFirstDisplayProcessor.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/LyricFirstDisplayProcessor.cs @@ -36,7 +36,7 @@ protected override void ProcessBindableChange(AvailableProperty property) }); property.TimeTagsBindable.BindCollectionChanged((_, _) => { - // If create/remove the time-tag, romanized syllable might be affected. + // If create/remove the time-tag, romanised syllable might be affected. UpdateBottomText(); UpdateTimeTags(); }); @@ -83,7 +83,7 @@ protected override IEnumerable CalculateBottomTexts(Lyric lyric) static PositionText toPositionText(int startCharIndex, int endCharIndex, TimeTag[] timeTags) { - string text = string.Join("", timeTags.Select(x => x.RomanizedSyllable)); + string text = string.Join("", timeTags.Select(x => x.RomanisedSyllable)); return new PositionText(text, startCharIndex, endCharIndex); } } diff --git a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanizedSyllableFirstDisplayProcessor.cs b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanisedSyllableFirstDisplayProcessor.cs similarity index 91% rename from osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanizedSyllableFirstDisplayProcessor.cs rename to osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanisedSyllableFirstDisplayProcessor.cs index 3616c2d1b..f59c1c075 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanizedSyllableFirstDisplayProcessor.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/Sprites/Processor/RomanisedSyllableFirstDisplayProcessor.cs @@ -8,9 +8,9 @@ namespace osu.Game.Rulesets.Karaoke.Graphics.Sprites.Processor; -public class RomanizedSyllableFirstDisplayProcessor : BaseDisplayProcessor +public class RomanisedSyllableFirstDisplayProcessor : BaseDisplayProcessor { - public RomanizedSyllableFirstDisplayProcessor(Lyric lyric, LyricDisplayProperty displayProperty) + public RomanisedSyllableFirstDisplayProcessor(Lyric lyric, LyricDisplayProperty displayProperty) : base(lyric, displayProperty) { // Note: some of the properties are not implemented yet because we are not sure people actually use it. @@ -59,7 +59,7 @@ protected override string CalculateCenterText(Lyric lyric) => string.Join("", lyric.TimeTags.Select((x, i) => { bool hasEmptySpace = i != 0 && x.FirstSyllable; - return hasEmptySpace ? " " + x.RomanizedSyllable : x.RomanizedSyllable; + return hasEmptySpace ? " " + x.RomanisedSyllable : x.RomanisedSyllable; })); protected override IEnumerable CalculateBottomTexts(Lyric lyric) diff --git a/osu.Game.Rulesets.Karaoke/Objects/TimeTag.cs b/osu.Game.Rulesets.Karaoke/Objects/TimeTag.cs index 3704a7b95..0b08864f5 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/TimeTag.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/TimeTag.cs @@ -17,7 +17,7 @@ public class TimeTag : IDeepCloneable public event Action? TimingChanged; /// - /// Invoked when or of this is changed. + /// Invoked when or of this is changed. /// public event Action? SyllableChanged; @@ -28,7 +28,7 @@ public TimeTag(TextIndex index, double? time = null) TimeBindable.ValueChanged += _ => TimingChanged?.Invoke(); FirstSyllableBindable.ValueChanged += _ => SyllableChanged?.Invoke(); - RomanizedSyllableBindable.ValueChanged += _ => SyllableChanged?.Invoke(); + RomanisedSyllableBindable.ValueChanged += _ => SyllableChanged?.Invoke(); } /// @@ -72,15 +72,15 @@ public bool FirstSyllable } [JsonIgnore] - public readonly Bindable RomanizedSyllableBindable = new(); + public readonly Bindable RomanisedSyllableBindable = new(); /// /// Romaji /// - public string? RomanizedSyllable + public string? RomanisedSyllable { - get => RomanizedSyllableBindable.Value; - set => RomanizedSyllableBindable.Value = value; + get => RomanisedSyllableBindable.Value; + set => RomanisedSyllableBindable.Value = value; } public TimeTag DeepClone() @@ -88,7 +88,7 @@ public TimeTag DeepClone() return new TimeTag(Index, Time) { FirstSyllable = FirstSyllable, - RomanizedSyllable = RomanizedSyllable, + RomanisedSyllable = RomanisedSyllable, }; } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs index f47eb76d6..c1864d6c4 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs @@ -35,7 +35,7 @@ public PreviewKaraokeSpriteText(Lyric lyric) { HitObject = lyric; - // should display ruby and romanization by default. + // should display ruby and romanisation by default. DisplayType = LyricDisplayType.Lyric; DisplayProperty = LyricDisplayProperty.Both; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorVerifier.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorVerifier.cs index e0904cfd8..001bfe3c7 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorVerifier.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorVerifier.cs @@ -200,6 +200,6 @@ public class CheckLyricTimeTagRomaji : CheckLyricTimeTag { protected override IEnumerable Check(Lyric lyric) { - return CheckTimeTagRomanizedSyllable(lyric); + return CheckTimeTagRomanisedSyllable(lyric); } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Romaji/RomajiEditSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Romaji/RomajiEditSection.cs index e66b401d0..c3a4e0969 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Romaji/RomajiEditSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Romaji/RomajiEditSection.cs @@ -69,7 +69,7 @@ protected override Drawable CreateDrawable(TimeTag item) }, RomajiEditPropertyMode.Initial => new LabelledInitialSwitchButton(item) { - Label = item.RomanizedSyllable ?? string.Empty, + Label = item.RomanisedSyllable ?? string.Empty, }, _ => throw new ArgumentOutOfRangeException(nameof(bindableRomajiEditPropertyMode.Value)), }; @@ -98,10 +98,10 @@ protected override void TriggerSelect(TimeTag item) => editRomajiModeState.Select(item); protected override string GetFieldValue(TimeTag timeTag) - => timeTag.RomanizedSyllable ?? string.Empty; + => timeTag.RomanisedSyllable ?? string.Empty; protected override void ApplyValue(TimeTag timeTag, string value) - => lyricTimeTagsChangeHandler.SetTimeTagRomanizedSyllable(timeTag, value); + => lyricTimeTagsChangeHandler.SetTimeTagRomanisedSyllable(timeTag, value); [BackgroundDependencyLoader] private void load() diff --git a/osu.Game.Rulesets.Karaoke/Utils/CharUtils.cs b/osu.Game.Rulesets.Karaoke/Utils/CharUtils.cs index 31964e4d7..812b30655 100644 --- a/osu.Game.Rulesets.Karaoke/Utils/CharUtils.cs +++ b/osu.Game.Rulesets.Karaoke/Utils/CharUtils.cs @@ -58,7 +58,7 @@ public static bool IsChinese(char c) /// /// Check this char is latin alphabet or not. - /// Usually, this is used to check the romanization result. + /// Usually, this is used to check the romanisation result. /// /// /// @@ -68,7 +68,7 @@ public static bool IsLatin(char c) { case >= 'A' and <= 'Z': case >= 'a' and <= 'z': - // another romanized characters + // another romanised characters // see: https://www.unicode.org/charts/PDF/U1E00.pdf case >= '\u1E00' and <= '\u1EFF': return true;