diff --git a/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/Formats/KaraokeLegacyBeatmapDecoderTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/Formats/KaraokeLegacyBeatmapDecoderTest.cs index f183f6e78..52fb001b1 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/Formats/KaraokeLegacyBeatmapDecoderTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/Formats/KaraokeLegacyBeatmapDecoderTest.cs @@ -61,7 +61,7 @@ public void TestDecodeBeatmapLyric() } [Test] - public void TestDecodeNote() + public void TestDecodeNotes() { // Karaoke beatmap var beatmap = decodeBeatmap("karaoke-note-samples"); @@ -77,34 +77,34 @@ public void TestDecodeNote() } [Test] - public void TestDecodeTranslate() + public void TestDecodeTranslations() { // Karaoke beatmap - var beatmap = decodeBeatmap("karaoke-translate-samples"); + var beatmap = decodeBeatmap("karaoke-translation-samples"); - // Get translate - var translates = beatmap.AvailableTranslates(); + // Get translations + var translations = beatmap.AvailableTranslationLanguages(); var lyrics = beatmap.HitObjects.OfType().ToList(); // Check is not null - Assert.IsNotNull(translates); + Assert.IsNotNull(translations); - // Check translate count - Assert.AreEqual(2, translates.Count); + // Check translations count + Assert.AreEqual(2, translations.Count); - // All lyric should have two translates - Assert.AreEqual(2, lyrics[0].Translates.Count); - Assert.AreEqual(2, lyrics[1].Translates.Count); + // All lyric should have two translations + Assert.AreEqual(2, lyrics[0].Translations.Count); + Assert.AreEqual(2, lyrics[1].Translations.Count); - // Check chinese translate - var chineseLanguageId = translates[0]; - Assert.AreEqual("卡拉OK", lyrics[0].Translates[chineseLanguageId]); - Assert.AreEqual("喜歡", lyrics[1].Translates[chineseLanguageId]); + // Check chinese translations + var chineseLanguageId = translations[0]; + Assert.AreEqual("卡拉OK", lyrics[0].Translations[chineseLanguageId]); + Assert.AreEqual("喜歡", lyrics[1].Translations[chineseLanguageId]); - // Check english translate - var englishLanguageId = translates[1]; - Assert.AreEqual("karaoke", lyrics[0].Translates[englishLanguageId]); - Assert.AreEqual("like it", lyrics[1].Translates[englishLanguageId]); + // Check english translations + var englishLanguageId = translations[1]; + Assert.AreEqual("karaoke", lyrics[0].Translations[englishLanguageId]); + Assert.AreEqual("like it", lyrics[1].Translations[englishLanguageId]); } private static KaraokeBeatmap decodeBeatmap(string fileName) diff --git a/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/TestSceneBeatmapInfoWedge.cs b/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/TestSceneBeatmapInfoWedge.cs index c386d961d..84147a0a0 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/TestSceneBeatmapInfoWedge.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Beatmaps/TestSceneBeatmapInfoWedge.cs @@ -39,7 +39,7 @@ protected override void LoadComplete() [TestCase("karaoke-file-samples")] [TestCase("karaoke-file-samples-without-note")] [TestCase("karaoke-note-samples")] - [TestCase("karaoke-translate-samples")] + [TestCase("karaoke-translation-samples")] public void TestNullBeatmap(string fileName) { using var resStream = TestResources.OpenBeatmapResource(fileName); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs index 44cdb094d..e8f49d21e 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs @@ -18,7 +18,7 @@ public void TestAdd() { SetUpKaraokeBeatmap(karaokeBeatmap => { - karaokeBeatmap.AvailableTranslates = new List + karaokeBeatmap.AvailableTranslationLanguages = new List { new("zh-TW"), }; @@ -31,9 +31,9 @@ public void TestAdd() AssertKaraokeBeatmap(karaokeBeatmap => { - Assert.AreEqual(2, karaokeBeatmap.AvailableTranslates.Count); - Assert.AreEqual(new CultureInfo("zh-TW"), karaokeBeatmap.AvailableTranslates[0]); - Assert.AreEqual(new CultureInfo("Ja-jp"), karaokeBeatmap.AvailableTranslates[1]); + Assert.AreEqual(2, karaokeBeatmap.AvailableTranslationLanguages.Count); + Assert.AreEqual(new CultureInfo("zh-TW"), karaokeBeatmap.AvailableTranslationLanguages[0]); + Assert.AreEqual(new CultureInfo("Ja-jp"), karaokeBeatmap.AvailableTranslationLanguages[1]); }); } @@ -42,7 +42,7 @@ public void TestRemove() { SetUpKaraokeBeatmap(karaokeBeatmap => { - karaokeBeatmap.AvailableTranslates = new List + karaokeBeatmap.AvailableTranslationLanguages = new List { new("zh-TW"), new("Ja-jp"), @@ -56,17 +56,17 @@ public void TestRemove() AssertKaraokeBeatmap(karaokeBeatmap => { - Assert.AreEqual(1, karaokeBeatmap.AvailableTranslates.Count); - Assert.AreEqual(new CultureInfo("zh-TW"), karaokeBeatmap.AvailableTranslates[0]); + Assert.AreEqual(1, karaokeBeatmap.AvailableTranslationLanguages.Count); + Assert.AreEqual(new CultureInfo("zh-TW"), karaokeBeatmap.AvailableTranslationLanguages[0]); }); } [Test] - public void TestIsLanguageContainsTranslate() + public void TestIsLanguageContainsTranslation() { SetUpKaraokeBeatmap(karaokeBeatmap => { - karaokeBeatmap.AvailableTranslates = new List + karaokeBeatmap.AvailableTranslationLanguages = new List { new("zh-TW"), new("Ja-jp"), @@ -75,7 +75,7 @@ public void TestIsLanguageContainsTranslate() PrepareHitObject(() => new Lyric { - Translates = new Dictionary + Translations = new Dictionary { { new("zh-TW"), "卡拉 OK" @@ -85,8 +85,8 @@ public void TestIsLanguageContainsTranslate() TriggerHandlerChanged(c => { - Assert.AreEqual(false, c.IsLanguageContainsTranslate(new CultureInfo("Ja-jp"))); - Assert.AreEqual(true, c.IsLanguageContainsTranslate(new CultureInfo("zh-TW"))); + Assert.AreEqual(false, c.IsLanguageContainsTranslation(new CultureInfo("Ja-jp"))); + Assert.AreEqual(true, c.IsLanguageContainsTranslation(new CultureInfo("zh-TW"))); }); } @@ -94,7 +94,7 @@ protected override void SetUpKaraokeBeatmap(Action action) { base.SetUpKaraokeBeatmap(karaokeBeatmap => { - karaokeBeatmap.AvailableTranslates = new List(); + karaokeBeatmap.AvailableTranslationLanguages = new List(); action(karaokeBeatmap); }); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslateChangeHandlerTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslationChangeHandlerTest.cs similarity index 56% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslateChangeHandlerTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslationChangeHandlerTest.cs index 4db43ad94..f47791931 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslateChangeHandlerTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Lyrics/LyricTranslationChangeHandlerTest.cs @@ -10,83 +10,83 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Editor.ChangeHandlers.Lyrics; -public partial class LyricTranslateChangeHandlerTest : LyricPropertyChangeHandlerTest +public partial class LyricTranslationChangeHandlerTest : LyricPropertyChangeHandlerTest { [Test] - public void TestUpdateTranslateWithNewLanguage() + public void TestUpdateTranslationWithNewLanguage() { PrepareHitObject(() => new Lyric { Text = "カラオケ", }); - TriggerHandlerChanged(c => c.UpdateTranslate(new CultureInfo(17), "からおけ")); + TriggerHandlerChanged(c => c.UpdateTranslation(new CultureInfo(17), "からおけ")); AssertSelectedHitObject(h => { - Assert.AreEqual(1, h.Translates.Count); - Assert.AreEqual("からおけ", h.Translates[new CultureInfo(17)]); + Assert.AreEqual(1, h.Translations.Count); + Assert.AreEqual("からおけ", h.Translations[new CultureInfo(17)]); }); } [Test] - public void TestUpdateTranslateWithExistLanguage() + public void TestUpdateTranslationWithExistLanguage() { PrepareHitObject(() => new Lyric { Text = "カラオケ", - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, }); - TriggerHandlerChanged(c => c.UpdateTranslate(new CultureInfo(17), "karaoke")); + TriggerHandlerChanged(c => c.UpdateTranslation(new CultureInfo(17), "karaoke")); AssertSelectedHitObject(h => { - Assert.AreEqual(1, h.Translates.Count); - Assert.AreEqual("karaoke", h.Translates[new CultureInfo(17)]); + Assert.AreEqual(1, h.Translations.Count); + Assert.AreEqual("karaoke", h.Translations[new CultureInfo(17)]); }); } [Test] - public void TestUpdateTranslateWithEmptyText() + public void TestUpdateTranslationWithEmptyText() { PrepareHitObject(() => new Lyric { Text = "カラオケ", - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, }); - TriggerHandlerChanged(c => c.UpdateTranslate(new CultureInfo(17), string.Empty)); + TriggerHandlerChanged(c => c.UpdateTranslation(new CultureInfo(17), string.Empty)); AssertSelectedHitObject(h => { - Assert.IsEmpty(h.Translates); + Assert.IsEmpty(h.Translations); }); } [Test] - public void TestUpdateTranslateWithNullText() + public void TestUpdateTranslationWithNullText() { PrepareHitObject(() => new Lyric { Text = "カラオケ", - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, }); - TriggerHandlerChanged(c => c.UpdateTranslate(new CultureInfo(17), string.Empty)); + TriggerHandlerChanged(c => c.UpdateTranslation(new CultureInfo(17), string.Empty)); AssertSelectedHitObject(h => { - Assert.IsEmpty(h.Translates); + Assert.IsEmpty(h.Translations); }); } @@ -98,6 +98,6 @@ public void TestWithReferenceLyric() Text = "カラオケ", }); - TriggerHandlerChangedWithException(c => c.UpdateTranslate(new CultureInfo(17), "からおけ")); + TriggerHandlerChangedWithException(c => c.UpdateTranslation(new CultureInfo(17), "からおけ")); } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslatesTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslationsTest.cs similarity index 54% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslatesTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslationsTest.cs index 8dd60aaa9..87b124ed9 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslatesTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckBeatmapAvailableTranslationsTest.cs @@ -12,12 +12,12 @@ using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Screens.Edit; using osu.Game.Tests.Beatmaps; -using static osu.Game.Rulesets.Karaoke.Edit.Checks.CheckBeatmapAvailableTranslates; +using static osu.Game.Rulesets.Karaoke.Edit.Checks.CheckBeatmapAvailableTranslations; namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Checks; [TestFixture] -public class CheckBeatmapAvailableTranslatesTest : BeatmapPropertyCheckTest +public class CheckBeatmapAvailableTranslationsTest : BeatmapPropertyCheckTest { [Test] public void TestNoLyricAndNoLanguage() @@ -32,8 +32,8 @@ public void TestNoLyricAndNoLanguage() public void TestNoLyricButHaveLanguage() { // test no lyric and have language. (should not show alert) - var translateLanguages = new List { new("Ja-jp") }; - var beatmap = createTestingBeatmap(translateLanguages, null); + var translationLanguages = new List { new("Ja-jp") }; + var beatmap = createTestingBeatmap(translationLanguages, null); AssertOk(getContext(beatmap)); } @@ -49,72 +49,72 @@ public void TestHaveLyricButNoLanguage() } [Test] - public void TestEveryLyricContainsTranslate() + public void TestEveryLyricContainsTranslation() { - var translateLanguages = new List { new("Ja-jp") }; - var beatmap = createTestingBeatmap(translateLanguages, new[] + var translationLanguages = new List { new("Ja-jp") }; + var beatmap = createTestingBeatmap(translationLanguages, new[] { - createLyric(new CultureInfo("Ja-jp"), "translate1"), - createLyric(new CultureInfo("Ja-jp"), "translate2"), + createLyric(new CultureInfo("Ja-jp"), "translation1"), + createLyric(new CultureInfo("Ja-jp"), "translation2"), }); AssertOk(getContext(beatmap)); } [Test] - public void TestCheckMissingTranslate() + public void TestCheckMissingTranslation() { - // no lyric with translate string. (should have issue) - var translateLanguages = new List { new("Ja-jp") }; - var beatmap = createTestingBeatmap(translateLanguages, new[] + // no lyric with translation string. (should have issue) + var translationLanguages = new List { new("Ja-jp") }; + var beatmap = createTestingBeatmap(translationLanguages, new[] { createLyric(), createLyric(), }); - AssertNotOk(getContext(beatmap)); + AssertNotOk(getContext(beatmap)); - // no lyric with translate string. (should have issue) - var beatmap2 = createTestingBeatmap(translateLanguages, new[] + // no lyric with translation string. (should have issue) + var beatmap2 = createTestingBeatmap(translationLanguages, new[] { createLyric(new CultureInfo("Ja-jp")), createLyric(), }); - AssertNotOk(getContext(beatmap2)); + AssertNotOk(getContext(beatmap2)); - // no lyric with translate string. (should have issue) - var beatmap3 = createTestingBeatmap(translateLanguages, new[] + // no lyric with translation string. (should have issue) + var beatmap3 = createTestingBeatmap(translationLanguages, new[] { createLyric(new CultureInfo("Ja-jp")), createLyric(new CultureInfo("Ja-jp"), string.Empty), }); - AssertNotOk(getContext(beatmap3)); + AssertNotOk(getContext(beatmap3)); } [Test] - public void TestCheckMissingPartialTranslate() + public void TestCheckMissingPartialTranslation() { - // some lyric with translate string. (should have issue) - var translateLanguages = new List { new("Ja-jp") }; - var beatmap4 = createTestingBeatmap(translateLanguages, new[] + // some lyric with translation string. (should have issue) + var translationLanguages = new List { new("Ja-jp") }; + var beatmap4 = createTestingBeatmap(translationLanguages, new[] { - createLyric(new CultureInfo("Ja-jp"), "translate1"), + createLyric(new CultureInfo("Ja-jp"), "translation1"), createLyric(new CultureInfo("Ja-jp")), }); - AssertNotOk(getContext(beatmap4)); + AssertNotOk(getContext(beatmap4)); } [Test] - public void TestCheckContainsNotListedLanguage() + public void TestCheckTranslationNotInListedLanguage() { - // lyric translate not listed. (should have issue) + // lyric translation not listed. (should have issue) var beatmap6 = createTestingBeatmap(null, new[] { - createLyric(new CultureInfo("en-US"), "translate1"), + createLyric(new CultureInfo("en-US"), "translation1"), }); - AssertNotOk(getContext(beatmap6)); + AssertNotOk(getContext(beatmap6)); } - private static IBeatmap createTestingBeatmap(List? translateLanguage, IEnumerable? lyrics) + private static IBeatmap createTestingBeatmap(List? translationLanguages, IEnumerable? lyrics) { var karaokeBeatmap = new KaraokeBeatmap { @@ -122,7 +122,7 @@ private static IBeatmap createTestingBeatmap(List? translateLanguag { Ruleset = new KaraokeRuleset().RulesetInfo, }, - AvailableTranslates = translateLanguage ?? new List(), + AvailableTranslationLanguages = translationLanguages ?? new List(), HitObjects = lyrics?.OfType().ToList() ?? new List(), }; return new EditorBeatmap(karaokeBeatmap); @@ -131,13 +131,13 @@ private static IBeatmap createTestingBeatmap(List? translateLanguag private static BeatmapVerifierContext getContext(IBeatmap beatmap) => new(beatmap, new TestWorkingBeatmap(beatmap)); - private static Lyric createLyric(CultureInfo? cultureInfo = null, string translate = null!) + private static Lyric createLyric(CultureInfo? cultureInfo = null, string translation = null!) { var lyric = new Lyric(); if (cultureInfo == null) return lyric; - lyric.Translates.Add(cultureInfo, translate); + lyric.Translations.Add(cultureInfo, translation); return lyric; } } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslateTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslationsTest.cs similarity index 82% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslateTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslationsTest.cs index 920ca82b8..3c8ee3f4a 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslateTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/Checks/CheckLyricTranslationsTest.cs @@ -7,20 +7,20 @@ using osu.Game.Rulesets.Karaoke.Edit.Checks; using osu.Game.Rulesets.Karaoke.Edit.Checks.Issues; using osu.Game.Rulesets.Karaoke.Objects; -using static osu.Game.Rulesets.Karaoke.Edit.Checks.CheckLyricTranslate; +using static osu.Game.Rulesets.Karaoke.Edit.Checks.CheckLyricTranslations; namespace osu.Game.Rulesets.Karaoke.Tests.Editor.Checks; -public class CheckLyricTranslateTest : HitObjectCheckTest +public class CheckLyricTranslationsTest : HitObjectCheckTest { - [TestCase("translate")] + [TestCase("translation")] [TestCase("k")] // not limit min size for now. [TestCase("翻譯")] // not limit language. public void TestCheck(string text) { var lyric = new Lyric { - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo("Ja-jp"), text }, }, @@ -37,7 +37,7 @@ public void TestCheckEmptyText(string text) { var lyric = new Lyric { - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo("Ja-jp"), text }, }, diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/LyricConverterTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/LyricConverterTest.cs index 2d1c58bc0..9c7d3c325 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/LyricConverterTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/LyricConverterTest.cs @@ -25,7 +25,7 @@ public void TestLyricConverterWithNoConfig() var lyric = new Lyric(); string expected = - $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{lyric.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translates\":{{}},\"samples\":[],\"auxiliary_samples\":[]}}"; + $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{lyric.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translations\":{{}},\"samples\":[],\"auxiliary_samples\":[]}}"; string actual = JsonConvert.SerializeObject(lyric, CreateSettings()); Assert.AreEqual(expected, actual); } @@ -36,7 +36,7 @@ public void TestDeserializeWithNoConfig() var expected = new Lyric(); string json = - $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{expected.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translates\":{{}},\"samples\":[],\"auxiliary_samples\":[]}}"; + $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{expected.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translations\":{{}},\"samples\":[],\"auxiliary_samples\":[]}}"; var actual = JsonConvert.DeserializeObject(json, CreateSettings())!; Assert.AreEqual(expected.ID, actual.ID); @@ -47,7 +47,7 @@ public void TestDeserializeWithNoConfig() Assert.AreEqual(expected.StartTime, actual.StartTime); Assert.AreEqual(expected.Duration, actual.Duration); Assert.AreEqual(expected.SingerIds, actual.SingerIds); - Assert.AreEqual(expected.Translates, actual.Translates); + Assert.AreEqual(expected.Translations, actual.Translations); Assert.AreEqual(expected.Language, actual.Language); Assert.AreEqual(expected.Lock, actual.Lock); Assert.AreEqual(expected.ReferenceLyric, actual.ReferenceLyric); @@ -84,7 +84,7 @@ public void TestLyricConverterWithReferenceConfig() }; string expected = - $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{lyric.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translates\":{{}},\"reference_lyric_id\":\"{lyric.ReferenceLyricId}\",\"reference_lyric_config\":{{\"$type\":\"ReferenceLyricConfig\"}},\"samples\":[],\"auxiliary_samples\":[]}}"; + $"{{\"time_preempt\":600.0,\"time_fade_in\":400.0,\"start_time_bindable\":0.0,\"samples_bindable\":[],\"id\":\"{lyric.ID}\",\"text\":\"\",\"time_tags\":[],\"ruby_tags\":[],\"singer_ids\":[],\"translations\":{{}},\"reference_lyric_id\":\"{lyric.ReferenceLyricId}\",\"reference_lyric_config\":{{\"$type\":\"ReferenceLyricConfig\"}},\"samples\":[],\"auxiliary_samples\":[]}}"; string actual = JsonConvert.SerializeObject(lyric, CreateSettings()); Assert.AreEqual(expected, actual); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslatesConverterTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslationConverterTest.cs similarity index 87% rename from osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslatesConverterTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslationConverterTest.cs index 9b9de83e9..2a900fdcd 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslatesConverterTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/TranslationConverterTest.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Karaoke.Tests.IO.Serialization.Converters; -public class TranslatesConverterTest : BaseSingleConverterTest +public class TranslationConverterTest : BaseSingleConverterTest { protected override IEnumerable CreateExtraConverts() { @@ -20,14 +20,14 @@ protected override IEnumerable CreateExtraConverts() [Test] public void TestSerialize() { - var translates = new Dictionary + var translations = new Dictionary { { new CultureInfo("en-US"), "karaoke" }, { new CultureInfo("Ja-jp"), "カラオケ" }, }; const string expected = "[{\"key\":1033,\"value\":\"karaoke\"},{\"key\":1041,\"value\":\"カラオケ\"}]"; - string actual = JsonConvert.SerializeObject(translates, CreateSettings()); + string actual = JsonConvert.SerializeObject(translations, CreateSettings()); Assert.AreEqual(expected, actual); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/KaraokeJsonSerializableExtensionsTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/KaraokeJsonSerializableExtensionsTest.cs index b46724fee..4466eabad 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/KaraokeJsonSerializableExtensionsTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/KaraokeJsonSerializableExtensionsTest.cs @@ -17,7 +17,7 @@ public void TestSerializeLyric() var lyric = new Lyric(); string expected = - @$"{{""time_preempt"":600.0,""time_fade_in"":400.0,""start_time_bindable"":0.0,""samples_bindable"":[],""id"":""{lyric.ID}"",""text"":"""",""time_tags"":[],""ruby_tags"":[],""singer_ids"":[],""translates"":[],""samples"":[],""auxiliary_samples"":[]}}"; + @$"{{""time_preempt"":600.0,""time_fade_in"":400.0,""start_time_bindable"":0.0,""samples_bindable"":[],""id"":""{lyric.ID}"",""text"":"""",""time_tags"":[],""ruby_tags"":[],""singer_ids"":[],""translations"":[],""samples"":[],""auxiliary_samples"":[]}}"; string actual = JsonConvert.SerializeObject(lyric, createSettings()); Assert.AreEqual(expected, actual); @@ -28,7 +28,7 @@ public void TestDeserializeLyric() { var expected = new Lyric(); string json = - @$"{{""time_preempt"":600.0,""time_fade_in"":400.0,""start_time_bindable"":0.0,""samples_bindable"":[],""id"":""{expected.ID}"",""text"":"""",""time_tags"":[],""ruby_tags"":[],""singer_ids"":[],""translates"":[],""samples"":[],""auxiliary_samples"":[]}}"; + @$"{{""time_preempt"":600.0,""time_fade_in"":400.0,""start_time_bindable"":0.0,""samples_bindable"":[],""id"":""{expected.ID}"",""text"":"""",""time_tags"":[],""ruby_tags"":[],""singer_ids"":[],""translations"":[],""samples"":[],""auxiliary_samples"":[]}}"; var actual = JsonConvert.DeserializeObject(json, createSettings())!; ObjectAssert.ArePropertyEqual(expected, actual); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Objects/LyricTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Objects/LyricTest.cs index 25cce6ae6..c9f7465f1 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Objects/LyricTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Objects/LyricTest.cs @@ -29,7 +29,7 @@ public void TestClone() StartTime = 1000, Duration = 4000, SingerIds = TestCaseElementIdHelper.CreateElementIdsByNumbers(new[] { 1, 2 }), - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo("en-US"), "karaoke" }, }, @@ -69,8 +69,8 @@ public void TestClone() Assert.AreNotSame(clonedLyric.SingerIdsBindable, lyric.SingerIdsBindable); CollectionAssert.AreEquivalent(clonedLyric.SingerIds, lyric.SingerIds); - Assert.AreNotSame(clonedLyric.TranslateTextBindable, lyric.TranslateTextBindable); - CollectionAssert.AreEquivalent(clonedLyric.Translates, lyric.Translates); + Assert.AreNotSame(clonedLyric.TranslationsBindable, lyric.TranslationsBindable); + CollectionAssert.AreEquivalent(clonedLyric.Translations, lyric.Translations); Assert.AreNotSame(clonedLyric.LanguageBindable, lyric.LanguageBindable); Assert.AreEqual(clonedLyric.Language, lyric.Language); @@ -103,7 +103,7 @@ public void TestSyncFromReferenceLyric() TimeTags = TestCaseTagHelper.ParseTimeTags(new[] { "[0,start]:1100#^ka" }), RubyTags = TestCaseTagHelper.ParseRubyTags(new[] { "[0]:か" }), SingerIds = TestCaseElementIdHelper.CreateElementIdsByNumbers(new[] { 1 }), - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, @@ -121,7 +121,7 @@ public void TestSyncFromReferenceLyric() TimeTagAssert.ArePropertyEqual(referencedLyric.TimeTags, lyric.TimeTags); RubyTagAssert.ArePropertyEqual(referencedLyric.RubyTags, lyric.RubyTags); Assert.AreEqual(referencedLyric.SingerIds, lyric.SingerIds); - Assert.AreEqual(referencedLyric.Translates, lyric.Translates); + Assert.AreEqual(referencedLyric.Translations, lyric.Translations); Assert.AreEqual(referencedLyric.Language, lyric.Language); } @@ -141,7 +141,7 @@ public void TestReferenceLyricPropertyChanged() referencedLyric.TimeTags = TestCaseTagHelper.ParseTimeTags(new[] { "[0,start]:1100^ka" }); referencedLyric.RubyTags = TestCaseTagHelper.ParseRubyTags(new[] { "[0]:か" }); referencedLyric.SingerIds = TestCaseElementIdHelper.CreateElementIdsByNumbers(new[] { 1 }); - referencedLyric.Translates = new Dictionary + referencedLyric.Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }; @@ -151,7 +151,7 @@ public void TestReferenceLyricPropertyChanged() TimeTagAssert.ArePropertyEqual(referencedLyric.TimeTags, lyric.TimeTags); RubyTagAssert.ArePropertyEqual(referencedLyric.RubyTags, lyric.RubyTags); Assert.AreEqual(referencedLyric.SingerIds, lyric.SingerIds); - Assert.AreEqual(referencedLyric.Translates, lyric.Translates); + Assert.AreEqual(referencedLyric.Translations, lyric.Translations); Assert.AreEqual(referencedLyric.Language, lyric.Language); } @@ -169,7 +169,7 @@ public void TestReferenceLyricListPropertyChanged() TimeTags = new[] { timeTag }, RubyTags = new[] { rubyTag }, SingerIds = TestCaseElementIdHelper.CreateElementIdsByNumbers(new[] { 1 }), - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, @@ -224,7 +224,7 @@ public void TestConfigChange() TimeTags = TestCaseTagHelper.ParseTimeTags(new[] { "[0,start]:1100#ka" }), RubyTags = TestCaseTagHelper.ParseRubyTags(new[] { "[0]:か" }), SingerIds = TestCaseElementIdHelper.CreateElementIdsByNumbers(new[] { 1 }), - Translates = new Dictionary + Translations = new Dictionary { { new CultureInfo(17), "からおけ" }, }, diff --git a/osu.Game.Rulesets.Karaoke.Tests/Resources/Testing/Beatmaps/karaoke-translate-samples.osu b/osu.Game.Rulesets.Karaoke.Tests/Resources/Testing/Beatmaps/karaoke-translation-samples.osu similarity index 100% rename from osu.Game.Rulesets.Karaoke.Tests/Resources/Testing/Beatmaps/karaoke-translate-samples.osu rename to osu.Game.Rulesets.Karaoke.Tests/Resources/Testing/Beatmaps/karaoke-translation-samples.osu diff --git a/osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslateScreen.cs b/osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslationsScreen.cs similarity index 81% rename from osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslateScreen.cs rename to osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslationsScreen.cs index f75e9ece6..79dea569b 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslateScreen.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Screens/Edit/Beatmap/TestSceneTranslationsScreen.cs @@ -10,22 +10,22 @@ using osu.Game.Overlays; using osu.Game.Rulesets.Karaoke.Beatmaps; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps; -using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; namespace osu.Game.Rulesets.Karaoke.Tests.Screens.Edit.Beatmap; [TestFixture] -public partial class TestSceneTranslateScreen : BeatmapEditorScreenTestScene +public partial class TestSceneTranslationsScreen : BeatmapEditorScreenTestScene { protected override Container Content { get; } = new Container { RelativeSizeAxes = Axes.Both }; - protected override TranslateScreen CreateEditorScreen() => new(); + protected override TranslationScreen CreateEditorScreen() => new(); protected override KaraokeBeatmap CreateBeatmap() { var karaokeBeatmap = base.CreateBeatmap(); - karaokeBeatmap.AvailableTranslates = new List + karaokeBeatmap.AvailableTranslationLanguages = new List { new("zh-TW"), new("en-US"), diff --git a/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs b/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs index a0990a813..e18e192b5 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs @@ -33,7 +33,7 @@ public TestSceneLyric() private void load() { var config = Dependencies.Get(); - config.SetValue(KaraokeRulesetSetting.PreferLanguage, cultureInfo); + config.SetValue(KaraokeRulesetSetting.PreferTranslationLanguage, cultureInfo); } private Drawable testSingle(double timeOffset = 0) @@ -91,7 +91,7 @@ private Drawable testSingle(double timeOffset = 0) }, new PreviewStageDefinition()), }; - lyric.Translates.Add(cultureInfo, "karaoke"); + lyric.Translations.Add(cultureInfo, "karaoke"); lyric.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs index c7c1ae2fb..107f7d757 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs @@ -33,7 +33,7 @@ public KaraokeLegacyBeatmapDecoder(int version = LATEST_VERSION) private readonly IList lrcLines = new List(); private readonly IList noteLines = new List(); - private readonly IList translates = new List(); + private readonly IList translations = new List(); protected override void ParseLine(Beatmap beatmap, Section section, string line) { @@ -62,8 +62,8 @@ protected override void ParseLine(Beatmap beatmap, Section section, string line) } else if (line.ToLower().StartsWith("@tr", StringComparison.Ordinal)) { - // add translate queue - translates.Add(line); + // add translation queue + translations.Add(line); } else if (line.StartsWith("@", StringComparison.Ordinal)) { @@ -91,7 +91,7 @@ protected override void ParseLine(Beatmap beatmap, Section section, string line) } processNotes(beatmap, noteLines); - processTranslate(beatmap, translates); + processTranslations(beatmap, translations); } } @@ -222,20 +222,20 @@ static Tone convertTone(string tone) } } - private void processTranslate(Beatmap beatmap, IEnumerable translateLines) + private void processTranslations(Beatmap beatmap, IEnumerable translationLines) { - var availableTranslates = new List(); + var availableTranslations = new List(); var lyrics = beatmap.HitObjects.OfType().ToList(); - var translations = translateLines.Select(translate => new + var translations = translationLines.Select(translation => new { - key = translate.Split('=').FirstOrDefault()?.Split('[').LastOrDefault()?.Split(']').FirstOrDefault(), - value = translate.Split('=').LastOrDefault() ?? string.Empty, + key = translation.Split('=').FirstOrDefault()?.Split('[').LastOrDefault()?.Split(']').FirstOrDefault(), + value = translation.Split('=').LastOrDefault() ?? string.Empty, }).GroupBy(x => x.key, y => y.value).ToList(); foreach (var translation in translations) { - // get culture and translate + // get culture and translation string? languageCode = translation.Key; if (string.IsNullOrEmpty(languageCode)) continue; @@ -247,15 +247,15 @@ private void processTranslate(Beatmap beatmap, IEnumerable translateLine for (int j = 0; j < size; j++) { - lyrics[j].Translates.Add(cultureInfo, values[j]); + lyrics[j].Translations.Add(cultureInfo, values[j]); } - availableTranslates.Add(cultureInfo); + availableTranslations.Add(cultureInfo); } var dictionary = new LegacyProperties { - AvailableTranslates = availableTranslates, + AvailableTranslationLanguages = availableTranslations, }; beatmap.HitObjects.Add(dictionary); diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapEncoder.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapEncoder.cs index c9277f66e..cd2efa9dc 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapEncoder.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapEncoder.cs @@ -17,14 +17,14 @@ public string Encode(Beatmap output) var results = new List { lrcEncoder.Encode(output), - string.Join("\n", encodeNote(output)), - string.Join("\n", encodeTranslate(output)), + string.Join("\n", encodeNotes(output)), + string.Join("\n", encodeTranslations(output)), }; return string.Join("\n\n", results.Where(x => !string.IsNullOrEmpty(x))); } - private IEnumerable encodeNote(Beatmap output) + private IEnumerable encodeNotes(Beatmap output) { var notes = output.HitObjects.OfType().ToList(); var lyrics = output.HitObjects.OfType().ToList(); @@ -61,20 +61,20 @@ static string convertNote(Note note) } } - private IEnumerable encodeTranslate(Beatmap output) + private IEnumerable encodeTranslations(Beatmap output) { - if (!output.AnyTranslate()) + if (!output.AnyTranslation()) yield break; var lyrics = output.HitObjects.OfType().ToList(); - var availableTranslates = output.AvailableTranslates(); + var availableTranslations = output.AvailableTranslationLanguages(); - foreach (var translate in availableTranslates) + foreach (var translation in availableTranslations) { foreach (var lyric in lyrics) { - string translateString = lyric.Translates.TryGetValue(translate, out string? value) ? value : string.Empty; - yield return $"@tr[{translate.Name}]={translateString}"; + string translationString = lyric.Translations.TryGetValue(translation, out string? value) ? value : string.Empty; + yield return $"@tr[{translation.Name}]={translationString}"; } } } diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs index 5d9d2f3c6..ac14e80a1 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Karaoke.Beatmaps; public class KaraokeBeatmap : Beatmap { - public IList AvailableTranslates { get; set; } = new List(); + public IList AvailableTranslationLanguages { get; set; } = new List(); public SingerInfo SingerInfo { get; set; } = new(); diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapConverter.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapConverter.cs index 0e6b20262..b38c6762e 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapConverter.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapConverter.cs @@ -33,7 +33,7 @@ protected override Beatmap ConvertBeatmap(IBeatmap original, C if (beatmap is not KaraokeBeatmap karaokeBeatmap) throw new InvalidCastException(nameof(beatmap)); - karaokeBeatmap.AvailableTranslates = propertyDictionary.AvailableTranslates; + karaokeBeatmap.AvailableTranslationLanguages = propertyDictionary.AvailableTranslationLanguages; beatmap.HitObjects.Remove(propertyDictionary); return beatmap; diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapExtension.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapExtension.cs index c581c44aa..299026342 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapExtension.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapExtension.cs @@ -17,9 +17,9 @@ public static bool IsScorable(this IBeatmap beatmap) return beatmap is KaraokeBeatmap karaokeBeatmap && karaokeBeatmap.Scorable; } - public static IList AvailableTranslates(this IBeatmap beatmap) => (beatmap as KaraokeBeatmap)?.AvailableTranslates ?? new List(); + public static IList AvailableTranslationLanguages(this IBeatmap beatmap) => (beatmap as KaraokeBeatmap)?.AvailableTranslationLanguages ?? new List(); - public static bool AnyTranslate(this IBeatmap beatmap) => beatmap.AvailableTranslates().Any(); + public static bool AnyTranslation(this IBeatmap beatmap) => beatmap.AvailableTranslationLanguages().Any(); public static float PitchToScale(this IBeatmap beatmap, float pitch) { diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs index a41c01084..35333375a 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs @@ -33,8 +33,8 @@ protected override void InitialiseDefaults() SetDefault(KaraokeRulesetSetting.NoteAlpha, 1, 0.2, 1, 0.01); SetDefault(KaraokeRulesetSetting.LyricAlpha, 1, 0.2, 1, 0.01); - // Translate - SetDefault(KaraokeRulesetSetting.PreferLanguage, new CultureInfo("en-US")); + // Translation + SetDefault(KaraokeRulesetSetting.PreferTranslationLanguage, new CultureInfo("en-US")); // Pitch SetDefault(KaraokeRulesetSetting.OverridePitchAtGameplay, false); @@ -61,8 +61,8 @@ protected override void InitialiseDefaults() SetDefault(KaraokeRulesetSetting.RomanisationFont, new FontUsage("Torus", 20, "Bold"), 8f, 48f); SetDefault(KaraokeRulesetSetting.RomanisationMargin, 0, 0, 20); SetDefault(KaraokeRulesetSetting.ForceUseDefaultFont, false); - SetDefault(KaraokeRulesetSetting.TranslateFont, new FontUsage("Torus", 18, "Bold"), 10f, 48f); - SetDefault(KaraokeRulesetSetting.ForceUseDefaultTranslateFont, false); + SetDefault(KaraokeRulesetSetting.TranslationFont, new FontUsage("Torus", 18, "Bold"), 10f, 48f); + SetDefault(KaraokeRulesetSetting.ForceUseDefaultTranslationFont, false); SetDefault(KaraokeRulesetSetting.NoteFont, new FontUsage("Torus", 12, "Bold"), 10f, 32f); SetDefault(KaraokeRulesetSetting.ForceUseDefaultNoteFont, false); } @@ -71,7 +71,7 @@ protected override void AddBindable(KaraokeRulesetSetting lookup, Bin { switch (lookup) { - case KaraokeRulesetSetting.PreferLanguage: + case KaraokeRulesetSetting.PreferTranslationLanguage: // todo : need to hve a default value here because it will cause error if object is null while saving. base.AddBindable(lookup, new BindableCultureInfo(bindable.Value as CultureInfo)); break; @@ -79,7 +79,7 @@ protected override void AddBindable(KaraokeRulesetSetting lookup, Bin case KaraokeRulesetSetting.MainFont: case KaraokeRulesetSetting.RubyFont: case KaraokeRulesetSetting.RomanisationFont: - case KaraokeRulesetSetting.TranslateFont: + case KaraokeRulesetSetting.TranslationFont: case KaraokeRulesetSetting.NoteFont: base.AddBindable(lookup, new BindableFontUsage(TypeUtils.ChangeType(bindable.Value))); break; @@ -111,7 +111,7 @@ protected BindableFontUsage SetDefault(KaraokeRulesetSetting setting, FontUsage new TrackedSetting(KaraokeRulesetSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")), new TrackedSetting(KaraokeRulesetSetting.DisplayNoteRubyText, b => new SettingDescription(b, "Toggle display", b ? "Show" : "Hide")), new TrackedSetting(KaraokeRulesetSetting.ShowCursor, b => new SettingDescription(b, "Cursor display", b ? "Show" : "Hide")), - new TrackedSetting(KaraokeRulesetSetting.PreferLanguage, c => new SettingDescription(c, "Translate language", CultureInfoUtils.GetLanguageDisplayText(c))), + new TrackedSetting(KaraokeRulesetSetting.PreferTranslationLanguage, c => new SettingDescription(c, "Translation language", CultureInfoUtils.GetLanguageDisplayText(c))), new TrackedSetting(KaraokeRulesetSetting.MicrophoneDevice, d => new SettingDescription(d, "Change to the new microphone device", d)), }; } @@ -126,8 +126,8 @@ public enum KaraokeRulesetSetting NoteAlpha, LyricAlpha, - // Translate - PreferLanguage, + // Translation + PreferTranslationLanguage, // Pitch OverridePitchAtGameplay, @@ -154,8 +154,8 @@ public enum KaraokeRulesetSetting RomanisationFont, RomanisationMargin, ForceUseDefaultFont, - TranslateFont, - ForceUseDefaultTranslateFont, + TranslationFont, + ForceUseDefaultTranslationFont, NoteFont, ForceUseDefaultNoteFont, } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/BeatmapListPropertyChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/BeatmapListPropertyChangeHandler.cs index f3f53cf2b..fad7c5285 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/BeatmapListPropertyChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/BeatmapListPropertyChangeHandler.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers; // todo: not a good design because eventually karaoke beatmap will not have the the field with list type. -// it should be wrap into class (e.g. localizationInfo) with list of translate inside. +// it should be wrap into class (e.g. localizationInfo) with list of translation inside. // so guess this class will be removed eventually. public abstract partial class BeatmapListPropertyChangeHandler : Component { diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs index e565d9b53..692c7927a 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs @@ -14,7 +14,7 @@ public partial class BeatmapLanguagesChangeHandler : BeatmapListPropertyChangeHa public IBindableList Languages => Items; protected override IList GetItemsFromBeatmap(KaraokeBeatmap beatmap) - => beatmap.AvailableTranslates; + => beatmap.AvailableTranslationLanguages; protected override void OnItemAdded(CultureInfo item) { @@ -24,12 +24,12 @@ protected override void OnItemAdded(CultureInfo item) protected override void OnItemRemoved(CultureInfo item) { // Delete from lyric also. - foreach (var lyric in Lyrics.Where(lyric => lyric.Translates.ContainsKey(item))) + foreach (var lyric in Lyrics.Where(lyric => lyric.Translations.ContainsKey(item))) { - lyric.Translates.Remove(item); + lyric.Translations.Remove(item); } } - public bool IsLanguageContainsTranslate(CultureInfo cultureInfo) - => Lyrics.Any(x => x.Translates.ContainsKey(cultureInfo)); + public bool IsLanguageContainsTranslation(CultureInfo cultureInfo) + => Lyrics.Any(x => x.Translations.ContainsKey(cultureInfo)); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs index 7161dd320..a20f47095 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs @@ -14,5 +14,5 @@ public interface IBeatmapLanguagesChangeHandler void Remove(CultureInfo culture); - bool IsLanguageContainsTranslate(CultureInfo cultureInfo); + bool IsLanguageContainsTranslation(CultureInfo cultureInfo); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslateChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslationChangeHandler.cs similarity index 62% rename from osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslateChangeHandler.cs rename to osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslationChangeHandler.cs index b4164b66d..b8de262e0 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslateChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/ILyricTranslationChangeHandler.cs @@ -5,7 +5,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics; -public interface ILyricTranslateChangeHandler : ILyricPropertyChangeHandler +public interface ILyricTranslationChangeHandler : ILyricPropertyChangeHandler { - void UpdateTranslate(CultureInfo cultureInfo, string translate); + void UpdateTranslation(CultureInfo cultureInfo, string translation); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslateChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslationChangeHandler.cs similarity index 52% rename from osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslateChangeHandler.cs rename to osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslationChangeHandler.cs index 17d0dea3b..4153de657 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslateChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Lyrics/LyricTranslationChangeHandler.cs @@ -8,28 +8,28 @@ namespace osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics; -public partial class LyricTranslateChangeHandler : LyricPropertyChangeHandler, ILyricTranslateChangeHandler +public partial class LyricTranslationChangeHandler : LyricPropertyChangeHandler, ILyricTranslationChangeHandler { - public void UpdateTranslate(CultureInfo cultureInfo, string translate) + public void UpdateTranslation(CultureInfo cultureInfo, string translation) { CheckExactlySelectedOneHitObject(); PerformOnSelection(lyric => { - // should not save translate if is null or empty or whitespace - if (string.IsNullOrWhiteSpace(translate)) + // should not save translation if is null or empty or whitespace + if (string.IsNullOrWhiteSpace(translation)) { - if (lyric.Translates.ContainsKey(cultureInfo)) - lyric.Translates.Remove(cultureInfo); + if (lyric.Translations.ContainsKey(cultureInfo)) + lyric.Translations.Remove(cultureInfo); } else { - if (!lyric.Translates.TryAdd(cultureInfo, translate)) - lyric.Translates[cultureInfo] = translate; + if (!lyric.Translations.TryAdd(cultureInfo, translation)) + lyric.Translations[cultureInfo] = translation; } }); } protected override bool IsWritePropertyLocked(Lyric lyric) - => HitObjectWritableUtils.IsWriteLyricPropertyLocked(lyric, nameof(Lyric.Translates)); + => HitObjectWritableUtils.IsWriteLyricPropertyLocked(lyric, nameof(Lyric.Translations)); } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslates.cs b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslations.cs similarity index 54% rename from osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslates.cs rename to osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslations.cs index 41a058711..99885bd2e 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslates.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckBeatmapAvailableTranslations.cs @@ -11,19 +11,19 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Checks; -public class CheckBeatmapAvailableTranslates : CheckBeatmapProperty, Lyric> +public class CheckBeatmapAvailableTranslations : CheckBeatmapProperty, Lyric> { protected override string Description => "Beatmap with invalid localization info."; public override IEnumerable PossibleTemplates => new IssueTemplate[] { - new IssueTemplateMissingTranslate(this), - new IssueTemplateMissingPartialTranslate(this), - new IssueTemplateContainsNotListedLanguage(this), + new IssueTemplateMissingTranslation(this), + new IssueTemplateMissingPartialTranslation(this), + new IssueTemplateTranslationNotInListedLanguage(this), }; protected override IList GetPropertyFromBeatmap(KaraokeBeatmap karaokeBeatmap) - => karaokeBeatmap.AvailableTranslates; + => karaokeBeatmap.AvailableTranslationLanguages; protected override IEnumerable CheckProperty(IList property) { @@ -36,37 +36,37 @@ protected override IEnumerable CheckHitObjects(IList propert if (hitObject.Count == 0) yield break; - // check if some translate is missing or empty. + // check if some translations is missing or empty. foreach (var language in property) { - var notTranslateLyrics = hitObject.Where(x => !x.Translates.ContainsKey(language) || string.IsNullOrWhiteSpace(x.Translates[language])).ToArray(); + var missingTranslationLyrics = hitObject.Where(x => !x.Translations.ContainsKey(language) || string.IsNullOrWhiteSpace(x.Translations[language])).ToArray(); - if (notTranslateLyrics.Length == hitObject.Count) + if (missingTranslationLyrics.Length == hitObject.Count) { - yield return new IssueTemplateMissingTranslate(this).Create(notTranslateLyrics, language); + yield return new IssueTemplateMissingTranslation(this).Create(missingTranslationLyrics, language); } - else if (notTranslateLyrics.Any()) + else if (missingTranslationLyrics.Any()) { - yield return new IssueTemplateMissingPartialTranslate(this).Create(notTranslateLyrics, language); + yield return new IssueTemplateMissingPartialTranslation(this).Create(missingTranslationLyrics, language); } } - // should check is lyric contains translate that is not listed in beatmap. + // should check is lyric contains translation that is not listed in beatmap. // if got this issue, then it's a bug. - var allTranslateLanguageInLyric = hitObject.SelectMany(x => x.Translates.Keys).Distinct(); - var languageNotListInBeatmap = allTranslateLanguageInLyric.Except(property); + var allTranslationLanguageInLyric = hitObject.SelectMany(x => x.Translations.Keys).Distinct(); + var languageNotListInBeatmap = allTranslationLanguageInLyric.Except(property); foreach (var language in languageNotListInBeatmap) { - var notTranslateLyrics = hitObject.Where(x => !x.Translates.ContainsKey(language)); + var notContainsTranslationLyrics = hitObject.Where(x => !x.Translations.ContainsKey(language)); - yield return new IssueTemplateContainsNotListedLanguage(this).Create(notTranslateLyrics, language); + yield return new IssueTemplateTranslationNotInListedLanguage(this).Create(notContainsTranslationLyrics, language); } } - public class IssueTemplateMissingTranslate : IssueTemplate + public class IssueTemplateMissingTranslation : IssueTemplate { - public IssueTemplateMissingTranslate(ICheck check) + public IssueTemplateMissingTranslation(ICheck check) : base(check, IssueType.Problem, "There are no lyric translations for this language.") { } @@ -75,9 +75,9 @@ public Issue Create(IEnumerable hitObjects, CultureInfo cultureInfo) => new(hitObjects, this, cultureInfo); } - public class IssueTemplateMissingPartialTranslate : IssueTemplate + public class IssueTemplateMissingPartialTranslation : IssueTemplate { - public IssueTemplateMissingPartialTranslate(ICheck check) + public IssueTemplateMissingPartialTranslation(ICheck check) : base(check, IssueType.Problem, "Some lyrics in this language are missing translations.") { } @@ -86,10 +86,10 @@ public Issue Create(IEnumerable hitObjects, CultureInfo cultureInfo) => new(hitObjects, this, cultureInfo); } - public class IssueTemplateContainsNotListedLanguage : IssueTemplate + public class IssueTemplateTranslationNotInListedLanguage : IssueTemplate { - public IssueTemplateContainsNotListedLanguage(ICheck check) - : base(check, IssueType.Problem, "Seems some translate language is not listed, plz contact developer to fix that bug.") + public IssueTemplateTranslationNotInListedLanguage(ICheck check) + : base(check, IssueType.Problem, "Seems some translation language is not listed in the beatmap, please contact developer to fix that bug.") { } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslate.cs b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslations.cs similarity index 83% rename from osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslate.cs rename to osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslations.cs index eb938d842..8fa0e6875 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslate.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Checks/CheckLyricTranslations.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Checks; -public class CheckLyricTranslate : CheckHitObjectProperty +public class CheckLyricTranslations : CheckHitObjectProperty { protected override string Description => "Lyric with invalid translations."; @@ -20,11 +20,11 @@ public class CheckLyricTranslate : CheckHitObjectProperty protected override IEnumerable Check(Lyric lyric) { - var translates = lyric.Translates; + var translations = lyric.Translations; - foreach ((var language, string translate) in translates) + foreach ((var language, string translation) in translations) { - if (string.IsNullOrWhiteSpace(translate)) + if (string.IsNullOrWhiteSpace(translation)) yield return new IssueTemplateEmptyText(this).Create(lyric, language); } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/KaraokeBeatmapVerifier.cs b/osu.Game.Rulesets.Karaoke/Edit/KaraokeBeatmapVerifier.cs index 53b7677b1..1132d98b7 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/KaraokeBeatmapVerifier.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/KaraokeBeatmapVerifier.cs @@ -13,7 +13,7 @@ public class KaraokeBeatmapVerifier : IBeatmapVerifier { private readonly List checks = new() { - new CheckBeatmapAvailableTranslates(), + new CheckBeatmapAvailableTranslations(), new CheckBeatmapClassicStageInfo(), new CheckBeatmapNoteInfo(), new CheckBeatmapPageInfo(), @@ -24,7 +24,7 @@ public class KaraokeBeatmapVerifier : IBeatmapVerifier new CheckLyricText(), new CheckLyricTime(), new CheckLyricTimeTag(), - new CheckLyricTranslate(), + new CheckLyricTranslations(), new CheckNoteReferenceLyric(), new CheckNoteText(), new CheckNoteTime(), diff --git a/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs b/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs index a8aad8149..f0d82fdd3 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs @@ -80,7 +80,7 @@ private static bool isWriteLyricPropertyLockedByState(LockState lockState, strin nameof(Lyric.StartTime) => lockState > LockState.Partial, nameof(Lyric.Duration) => lockState > LockState.Partial, nameof(Lyric.SingerIds) => lockState > LockState.Partial, - nameof(Lyric.Translates) => lockState > LockState.Partial, + nameof(Lyric.Translations) => lockState > LockState.Partial, nameof(Lyric.Language) => lockState > LockState.Partial, nameof(Lyric.Order) => false, // order can always be changed. nameof(Lyric.Lock) => false, // order can always be changed. @@ -106,7 +106,7 @@ private static bool isWriteLyricPropertyLockedByConfig(IReferenceLyricPropertyCo nameof(Lyric.StartTime) => false, nameof(Lyric.Duration) => false, nameof(Lyric.SingerIds) => syncLyricConfig.SyncSingerProperty, - nameof(Lyric.Translates) => true, + nameof(Lyric.Translations) => true, nameof(Lyric.Language) => true, nameof(Lyric.Order) => true, nameof(Lyric.Lock) => true, diff --git a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs index 310a7303a..43975fcf3 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/FontSelector.cs @@ -327,7 +327,7 @@ private void load(OsuColour colours) _ => throw new ArgumentOutOfRangeException(nameof(fontFormat)), }; - // todo : might apply translate. + // todo : might apply translation. badgeText.Text = fontFormat.ToString(); } } diff --git a/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/LyricConverter.cs b/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/LyricConverter.cs index f216b69f8..8885806a9 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/LyricConverter.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/LyricConverter.cs @@ -78,7 +78,7 @@ private IEnumerable removePropertyNamesByConfig(IReferenceLyricPropertyC if (syncLyricConfig.SyncSingerProperty) yield return nameof(Lyric.SingerIds); - yield return nameof(Lyric.Translates); + yield return nameof(Lyric.Translations); yield return nameof(Lyric.Language); yield return nameof(Lyric.Order); diff --git a/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslatesConverter.cs b/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslationConverter.cs similarity index 76% rename from osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslatesConverter.cs rename to osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslationConverter.cs index beb80782b..75535a738 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslatesConverter.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Serialization/Converters/TranslationConverter.cs @@ -5,6 +5,6 @@ namespace osu.Game.Rulesets.Karaoke.IO.Serialization.Converters; -public class TranslatesConverter : DictionaryConverter +public class TranslationConverter : DictionaryConverter { } diff --git a/osu.Game.Rulesets.Karaoke/IO/Serialization/KaraokeJsonSerializableExtensions.cs b/osu.Game.Rulesets.Karaoke/IO/Serialization/KaraokeJsonSerializableExtensions.cs index 9b05e6c2e..ab3692f21 100644 --- a/osu.Game.Rulesets.Karaoke/IO/Serialization/KaraokeJsonSerializableExtensions.cs +++ b/osu.Game.Rulesets.Karaoke/IO/Serialization/KaraokeJsonSerializableExtensions.cs @@ -24,7 +24,7 @@ public static JsonSerializerSettings CreateGlobalSettings() globalSetting.Converters.Add(new TimeTagConverter()); globalSetting.Converters.Add(new TimeTagsConverter()); globalSetting.Converters.Add(new ToneConverter()); - globalSetting.Converters.Add(new TranslatesConverter()); + globalSetting.Converters.Add(new TranslationConverter()); globalSetting.Converters.Add(new ReferenceLyricPropertyConfigConverter()); globalSetting.Converters.Add(new LyricConverter()); diff --git a/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs b/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs index 5d3cb67ac..7f59b7e64 100644 --- a/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs +++ b/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs @@ -44,9 +44,9 @@ public static class KaraokeSettingsSubsectionStrings public static LocalisableString PreferLanguage => new TranslatableString(getKey(@"prefer_language"), @"Prefer language"); /// - /// "Select prefer translate language." + /// "Select prefer translation language." /// - public static LocalisableString PreferLanguageTooltip => new TranslatableString(getKey(@"prefer_language_tooltip"), @"Select prefer translate language."); + public static LocalisableString PreferTranslationLanguageTooltip => new TranslatableString(getKey(@"prefer_language_tooltip"), @"Select prefer translation language."); /// /// "Microphone device" diff --git a/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs index f3caec1a6..bfc5bd350 100644 --- a/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs +++ b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs @@ -33,7 +33,7 @@ public void ApplyToDrawableHitObject(DrawableHitObject drawable) static CultureInfo? getPreferLanguage(IReadOnlyDependencyContainer dependencyContainer) { var config = dependencyContainer.Get(); - return config.Get(KaraokeRulesetSetting.PreferLanguage); + return config.Get(KaraokeRulesetSetting.PreferTranslationLanguage); } } } diff --git a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs index dd68787b6..b0783acf0 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs @@ -22,9 +22,9 @@ namespace osu.Game.Rulesets.Karaoke.Objects.Drawables; public partial class DrawableLyric : DrawableKaraokeHitObject { private Container lyricPieces = null!; - private OsuSpriteText translateText = null!; + private OsuSpriteText translationText = null!; - private readonly BindableBool useTranslateBindable = new(); + private readonly BindableBool useTranslationBindable = new(); private readonly Bindable preferLanguageBindable = new(); private readonly Bindable mainFontUsageBindable = new(); @@ -32,10 +32,10 @@ public partial class DrawableLyric : DrawableKaraokeHitObject private readonly Bindable rubyMarginBindable = new(); private readonly Bindable romanisationFontUsageBindable = new(); private readonly Bindable romanisationMarginBindable = new(); - private readonly Bindable translateFontUsageBindable = new(); + private readonly Bindable translationFontUsageBindable = new(); private readonly IBindableDictionary singersBindable = new BindableDictionary(); - private readonly BindableDictionary translateTextBindable = new(); + private readonly BindableDictionary translationTextBindable = new(); public event Action? OnLyricStart; public event Action? OnLyricEnd; @@ -61,14 +61,14 @@ private void load(KaraokeRulesetConfigManager? config) { AutoSizeAxes = Axes.Both, }); - AddInternal(translateText = new OsuSpriteText + AddInternal(translationText = new OsuSpriteText { Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, }); - useTranslateBindable.BindValueChanged(_ => applyTranslate(), true); - preferLanguageBindable.BindValueChanged(_ => applyTranslate(), true); + useTranslationBindable.BindValueChanged(_ => applyTranslation(), true); + preferLanguageBindable.BindValueChanged(_ => applyTranslation(), true); if (config != null) { @@ -77,7 +77,7 @@ private void load(KaraokeRulesetConfigManager? config) config.BindWith(KaraokeRulesetSetting.RubyMargin, rubyMarginBindable); config.BindWith(KaraokeRulesetSetting.RomanisationFont, romanisationFontUsageBindable); config.BindWith(KaraokeRulesetSetting.RomanisationMargin, romanisationMarginBindable); - config.BindWith(KaraokeRulesetSetting.TranslateFont, translateFontUsageBindable); + config.BindWith(KaraokeRulesetSetting.TranslationFont, translationFontUsageBindable); } mainFontUsageBindable.BindValueChanged(_ => updateLyricFontInfo()); @@ -85,11 +85,11 @@ private void load(KaraokeRulesetConfigManager? config) rubyMarginBindable.BindValueChanged(_ => updateLyricFontInfo()); romanisationFontUsageBindable.BindValueChanged(_ => updateLyricFontInfo()); romanisationMarginBindable.BindValueChanged(_ => updateLyricFontInfo()); - translateFontUsageBindable.BindValueChanged(_ => updateLyricFontInfo()); + translationFontUsageBindable.BindValueChanged(_ => updateLyricFontInfo()); // property in hitobject. singersBindable.BindCollectionChanged((_, _) => { updateFontStyle(); }); - translateTextBindable.BindCollectionChanged((_, _) => { applyTranslate(); }); + translationTextBindable.BindCollectionChanged((_, _) => { applyTranslation(); }); } public void ChangeDisplayType(LyricDisplayType lyricDisplayType) @@ -104,11 +104,11 @@ public void ChangeDisplayProperty(LyricDisplayProperty lyricDisplayProperty) public void ChangePreferTranslationLanguage(CultureInfo? language) { - if (language != null && translateTextBindable.TryGetValue(language, out string? translate)) - translateText.Text = translate; + if (language != null && translationTextBindable.TryGetValue(language, out string? translation)) + translationText.Text = translation; else { - translateText.Text = string.Empty; + translationText.Text = string.Empty; } } @@ -121,7 +121,7 @@ protected override void OnApply() ApplySkin(CurrentSkin, false); singersBindable.BindTo(HitObject.SingersBindable); - translateTextBindable.BindTo(HitObject.TranslateTextBindable); + translationTextBindable.BindTo(HitObject.TranslationsBindable); } protected override void OnFree() @@ -129,7 +129,7 @@ protected override void OnFree() base.OnFree(); singersBindable.UnbindFrom(HitObject.SingersBindable); - translateTextBindable.UnbindFrom(HitObject.TranslateTextBindable); + translationTextBindable.UnbindFrom(HitObject.TranslationsBindable); } protected override void ApplySkin(ISkinSource skin, bool allowFallback) @@ -164,19 +164,19 @@ private void updateLyricFontInfo() lyricFontInfo?.ApplyTo(this); } - private void applyTranslate() + private void applyTranslation() { var language = preferLanguageBindable.Value; - bool needTranslate = useTranslateBindable.Value; + bool useTranslation = useTranslationBindable.Value; - if (!needTranslate || language == null) + if (!useTranslation || language == null) { - translateText.Text = string.Empty; + translationText.Text = string.Empty; } else { - if (translateTextBindable.TryGetValue(language, out string? translate)) - translateText.Text = translate; + if (translationTextBindable.TryGetValue(language, out string? translation)) + translationText.Text = translation; } } @@ -216,8 +216,8 @@ public void ApplyToLyricPieces(Action action) action?.Invoke(lyricPiece); } - public void ApplyToTranslateText(Action action) + public void ApplyToTranslationText(Action action) { - action?.Invoke(translateText); + action?.Invoke(translationText); } } diff --git a/osu.Game.Rulesets.Karaoke/Objects/LegacyProperties.cs b/osu.Game.Rulesets.Karaoke/Objects/LegacyProperties.cs index 004bc7869..8f71673c2 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/LegacyProperties.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/LegacyProperties.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Karaoke.Objects; // todo: this function is used for legacy karaoke beatmap, will be removed eventually. public class LegacyProperties : KaraokeHitObject { - public IList AvailableTranslates { get; set; } = new List(); + public IList AvailableTranslationLanguages { get; set; } = new List(); public IDictionary Singers { get; set; } = new Dictionary(); } diff --git a/osu.Game.Rulesets.Karaoke/Objects/Lyric.cs b/osu.Game.Rulesets.Karaoke/Objects/Lyric.cs index e83fe1882..313ae29da 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/Lyric.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/Lyric.cs @@ -94,18 +94,18 @@ public IList SingerIds } [JsonIgnore] - public readonly BindableDictionary TranslateTextBindable = new(); + public readonly BindableDictionary TranslationsBindable = new(); /// - /// Translates + /// Translations /// - public IDictionary Translates + public IDictionary Translations { - get => TranslateTextBindable; + get => TranslationsBindable; set { - TranslateTextBindable.Clear(); - TranslateTextBindable.AddRange(value); + TranslationsBindable.Clear(); + TranslationsBindable.AddRange(value); } } diff --git a/osu.Game.Rulesets.Karaoke/Objects/Lyric_Binding.cs b/osu.Game.Rulesets.Karaoke/Objects/Lyric_Binding.cs index d6e0c83a0..e232a0dd4 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/Lyric_Binding.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/Lyric_Binding.cs @@ -246,13 +246,13 @@ private void initReferenceLyricEvent() SingerIds = lyric.SingerIds; }); - // translates. - bindDictionaryValueChange(e, l => l.TranslateTextBindable, (lyric, config) => + // translations. + bindDictionaryValueChange(e, l => l.TranslationsBindable, (lyric, config) => { if (config is not SyncLyricConfig) return; - Translates = lyric.Translates; + Translations = lyric.Translations; }); // language. diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditor.cs index 752b8a8b3..ab6bddfb4 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditor.cs @@ -18,7 +18,7 @@ using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Singers; -using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; using osu.Game.Rulesets.Karaoke.Skinning.Fonts; using osu.Game.Screens.Edit.Components.Menus; @@ -86,7 +86,7 @@ protected override GenericEditorScreen GenerateS { KaraokeBeatmapEditorScreenMode.Lyric => new LyricEditorScreen(), KaraokeBeatmapEditorScreenMode.Singer => new SingerScreen(), - KaraokeBeatmapEditorScreenMode.Translate => new TranslateScreen(), + KaraokeBeatmapEditorScreenMode.Translation => new TranslationScreen(), KaraokeBeatmapEditorScreenMode.Page => new PageScreen(), _ => throw new InvalidOperationException("Editor menu bar switched to an unsupported mode"), }; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditorScreenMode.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditorScreenMode.cs index ec0e6b348..ffece83f3 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditorScreenMode.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/KaraokeBeatmapEditorScreenMode.cs @@ -13,8 +13,8 @@ public enum KaraokeBeatmapEditorScreenMode [Description("Singer")] Singer, - [Description("Translate")] - Translate, + [Description("Translation")] + Translation, [Description("Page")] Page, diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/CreateNewLanguageButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs similarity index 98% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/CreateNewLanguageButton.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs index 0ecbce7e3..c9042342e 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/CreateNewLanguageButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Components.UserInterfaceV2; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; public partial class CreateNewLanguageButton : IconButton, IHasPopover { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LanguageDropdown.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LanguageDropdown.cs similarity index 96% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LanguageDropdown.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LanguageDropdown.cs index f616f2cc2..2ef037cbf 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LanguageDropdown.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LanguageDropdown.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Utils; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; public partial class LanguageDropdown : OsuDropdown { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LyricTranslateTextBox.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LyricTranslationTextBox.cs similarity index 79% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LyricTranslateTextBox.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LyricTranslationTextBox.cs index a3c5ef44c..8deb4febe 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/LyricTranslateTextBox.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/LyricTranslationTextBox.cs @@ -10,24 +10,24 @@ using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Screens.Edit; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; -public partial class LyricTranslateTextBox : OsuTextBox +public partial class LyricTranslationTextBox : OsuTextBox { [Resolved] private EditorBeatmap beatmap { get; set; } = null!; [Resolved] - private ILyricTranslateChangeHandler lyricTranslateChangeHandler { get; set; } = null!; + private ILyricTranslationChangeHandler lyricTranslationChangeHandler { get; set; } = null!; [Resolved] - private ITranslateInfoProvider translateInfoProvider { get; set; } = null!; + private ITranslationInfoProvider translationInfoProvider { get; set; } = null!; private readonly IBindable currentLanguage = new Bindable(); private readonly Lyric lyric; - public LyricTranslateTextBox(Lyric lyric) + public LyricTranslationTextBox(Lyric lyric) { this.lyric = lyric; @@ -36,7 +36,7 @@ public LyricTranslateTextBox(Lyric lyric) var cultureInfo = v.NewValue; // disable and clear text box if contains no language in language list. - Text = cultureInfo != null ? translateInfoProvider.GetLyricTranslate(lyric, cultureInfo) : null; + Text = cultureInfo != null ? translationInfoProvider.GetLyricTranslation(lyric, cultureInfo) : null; ScheduleAfterChildren(() => { Current.Disabled = cultureInfo == null; @@ -54,7 +54,7 @@ public LyricTranslateTextBox(Lyric lyric) if (cultureInfo == null) return; - lyricTranslateChangeHandler.UpdateTranslate(cultureInfo, text); + lyricTranslationChangeHandler.UpdateTranslation(cultureInfo, text); }; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/TranslateLyricSpriteText.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/PreviewLyricSpriteText.cs similarity index 77% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/TranslateLyricSpriteText.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/PreviewLyricSpriteText.cs index 7ca5934c3..11864be12 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/TranslateLyricSpriteText.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/PreviewLyricSpriteText.cs @@ -6,11 +6,11 @@ using osu.Game.Rulesets.Karaoke.Graphics.Sprites; using osu.Game.Rulesets.Karaoke.Objects; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; -public partial class TranslateLyricSpriteText : DrawableLyricSpriteText, IHasCustomTooltip +public partial class PreviewLyricSpriteText : DrawableLyricSpriteText, IHasCustomTooltip { - public TranslateLyricSpriteText(Lyric hitObject) + public PreviewLyricSpriteText(Lyric hitObject) : base(hitObject) { TooltipContent = hitObject; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/RemoveLanguageButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs similarity index 96% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/RemoveLanguageButton.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs index 1d90299bc..9efc98e0b 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/Components/RemoveLanguageButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs @@ -9,7 +9,7 @@ using osu.Game.Overlays; using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; public partial class RemoveLanguageButton : IconButton { @@ -27,7 +27,7 @@ public RemoveLanguageButton() Icon = FontAwesome.Solid.Trash; Action = () => { - if (beatmapLanguagesChangeHandler.IsLanguageContainsTranslate(currentLanguage.Value)) + if (beatmapLanguagesChangeHandler.IsLanguageContainsTranslation(currentLanguage.Value)) { dialogOverlay.Push(new DeleteLanguagePopupDialog(currentLanguage.Value, isOk => { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/DeleteLanguagePopupDialog.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/DeleteLanguagePopupDialog.cs similarity index 94% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/DeleteLanguagePopupDialog.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/DeleteLanguagePopupDialog.cs index 0bb5c40d2..707ad025a 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/DeleteLanguagePopupDialog.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/DeleteLanguagePopupDialog.cs @@ -7,7 +7,7 @@ using osu.Game.Overlays.Dialog; using osu.Game.Rulesets.Karaoke.Utils; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; public partial class DeleteLanguagePopupDialog : PopupDialog { @@ -15,7 +15,7 @@ public DeleteLanguagePopupDialog(CultureInfo currentLanguage, Action okAct { Icon = FontAwesome.Regular.TrashAlt; HeaderText = $"Confirm deletion of language {CultureInfoUtils.GetLanguageDisplayText(currentLanguage)}?"; - BodyText = "It will also remove the translate."; + BodyText = "It will also remove the translations."; Buttons = new PopupDialogButton[] { new PopupDialogOkButton diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/ITranslateInfoProvider.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/ITranslationInfoProvider.cs similarity index 70% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/ITranslateInfoProvider.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/ITranslationInfoProvider.cs index 3459d312e..09675710d 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/ITranslateInfoProvider.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/ITranslationInfoProvider.cs @@ -4,9 +4,9 @@ using System.Globalization; using osu.Game.Rulesets.Karaoke.Objects; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; -public interface ITranslateInfoProvider +public interface ITranslationInfoProvider { - string? GetLyricTranslate(Lyric lyric, CultureInfo cultureInfo); + string? GetLyricTranslation(Lyric lyric, CultureInfo cultureInfo); } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateEditSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs similarity index 90% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateEditSection.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs index 17f9ac42f..2c25d126a 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateEditSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs @@ -16,12 +16,12 @@ using osu.Game.Rulesets.Karaoke.Graphics.Shapes; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Objects.Utils; -using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate.Components; +using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; -[Cached(typeof(ITranslateInfoProvider))] -public partial class TranslateEditSection : Container, ITranslateInfoProvider +[Cached(typeof(ITranslationInfoProvider))] +public partial class TranslationEditSection : Container, ITranslationInfoProvider { private const int row_height = 50; private const int column_spacing = 10; @@ -39,7 +39,7 @@ public partial class TranslateEditSection : Container, ITranslateInfoProvider private readonly IBindableList bindableLyrics = new BindableList(); - public TranslateEditSection() + public TranslationEditSection() { Padding = new MarginPadding(10); @@ -51,7 +51,7 @@ public TranslateEditSection() new Dimension(GridSizeMode.Absolute, column_spacing), new Dimension(), }; - GridContainer translateGrid; + GridContainer translationsGrid; Child = new FillFlowContainer { @@ -161,9 +161,9 @@ public TranslateEditSection() }, }, }, - translateGrid = new GridContainer + translationsGrid = new GridContainer { - Name = "Translates", + Name = "Translations", ColumnDimensions = columnDimensions, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -182,8 +182,8 @@ public TranslateEditSection() bindableLyrics.BindCollectionChanged((_, _) => { // just re-create all the view, lazy to save the performance in here. - translateGrid.RowDimensions = bindableLyrics.Select(_ => new Dimension(GridSizeMode.Absolute, row_height)).ToArray(); - translateGrid.Content = createContent(); + translationsGrid.RowDimensions = bindableLyrics.Select(_ => new Dimension(GridSizeMode.Absolute, row_height)).ToArray(); + translationsGrid.Content = createContent(); }); } @@ -208,7 +208,7 @@ private Drawable[][] createContent() Empty(), createPreviewSpriteText(x), Empty(), - createTranslateTextBox(x), + createTranslationTextBox(x), }; }).ToArray(); } @@ -227,7 +227,7 @@ private Drawable createTimeDrawable(Lyric lyric) } private Drawable createPreviewSpriteText(Lyric lyric) => - new TranslateLyricSpriteText(lyric) + new PreviewLyricSpriteText(lyric) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -240,8 +240,8 @@ private Drawable createPreviewSpriteText(Lyric lyric) => BottomTextFont = new FontUsage(size: 10), }; - private Drawable createTranslateTextBox(Lyric lyric) => - new LyricTranslateTextBox(lyric) + private Drawable createTranslationTextBox(Lyric lyric) => + new LyricTranslationTextBox(lyric) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -250,10 +250,10 @@ private Drawable createTranslateTextBox(Lyric lyric) => CommitOnFocusLost = true, }; - public string? GetLyricTranslate(Lyric lyric, CultureInfo cultureInfo) + public string? GetLyricTranslation(Lyric lyric, CultureInfo cultureInfo) { ArgumentNullException.ThrowIfNull(cultureInfo); - return lyric.Translates.TryGetValue(cultureInfo, out string? translate) ? translate : null; + return lyric.Translations.TryGetValue(cultureInfo, out string? translation) ? translation : null; } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateScreen.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs similarity index 65% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateScreen.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs index fc2520b46..ab6e2e2a9 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translate/TranslateScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs @@ -10,21 +10,21 @@ using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translate; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; -public partial class TranslateScreen : BeatmapEditorRoundedScreen +public partial class TranslationScreen : BeatmapEditorRoundedScreen { [Cached(typeof(IBeatmapLanguagesChangeHandler))] private readonly BeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler; - [Cached(typeof(ILyricTranslateChangeHandler))] - private readonly LyricTranslateChangeHandler lyricTranslateChangeHandler; + [Cached(typeof(ILyricTranslationChangeHandler))] + private readonly LyricTranslationChangeHandler lyricTranslationChangeHandler; - public TranslateScreen() - : base(KaraokeBeatmapEditorScreenMode.Translate) + public TranslationScreen() + : base(KaraokeBeatmapEditorScreenMode.Translation) { AddInternal(beatmapLanguagesChangeHandler = new BeatmapLanguagesChangeHandler()); - AddInternal(lyricTranslateChangeHandler = new LyricTranslateChangeHandler()); + AddInternal(lyricTranslationChangeHandler = new LyricTranslationChangeHandler()); } [BackgroundDependencyLoader] @@ -32,11 +32,11 @@ private void load() { Add(new SectionsContainer { - FixedHeader = new TranslateScreenHeader(), + FixedHeader = new TranslationScreenHeader(), RelativeSizeAxes = Axes.Both, Children = new Container[] { - new TranslateEditSection + new TranslationEditSection { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -45,15 +45,15 @@ private void load() }); } - internal partial class TranslateScreenHeader : OverlayHeader + internal partial class TranslationScreenHeader : OverlayHeader { - protected override OverlayTitle CreateTitle() => new TranslateScreenTitle(); + protected override OverlayTitle CreateTitle() => new TranslationScreenTitle(); - private partial class TranslateScreenTitle : OverlayTitle + private partial class TranslationScreenTitle : OverlayTitle { - public TranslateScreenTitle() + public TranslationScreenTitle() { - Title = "translate"; + Title = "translation"; Description = "create translation of your beatmap"; Icon = OsuIcon.Online; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Components/Issues/IssueIcon.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Components/Issues/IssueIcon.cs index 4f0191594..5a7321ac8 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Components/Issues/IssueIcon.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Components/Issues/IssueIcon.cs @@ -65,7 +65,7 @@ private static IconUsage getIconByIssueTemplate(IssueTemplate issueTemplate) private static IconUsage getIconUsageByCheck(ICheck check) => check switch { - CheckBeatmapAvailableTranslates => FontAwesome.Solid.Language, + CheckBeatmapAvailableTranslations => FontAwesome.Solid.Language, CheckBeatmapClassicStageInfo => FontAwesome.Solid.AlignLeft, CheckBeatmapNoteInfo => FontAwesome.Solid.Microphone, CheckBeatmapPageInfo => FontAwesome.Solid.Pager, @@ -76,7 +76,7 @@ private static IconUsage getIconUsageByCheck(ICheck check) => CheckLyricText => FontAwesome.Solid.TextHeight, CheckLyricTime => FontAwesome.Solid.Times, CheckLyricTimeTag => FontAwesome.Solid.Tag, - CheckLyricTranslate => FontAwesome.Solid.Language, + CheckLyricTranslations => FontAwesome.Solid.Language, CheckNoteReferenceLyric => FontAwesome.Solid.Link, CheckNoteText => FontAwesome.Solid.Link, CheckNoteTime => FontAwesome.Solid.Times, diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs index 151fa9fe0..b8cf2efec 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/LyricPreview.cs @@ -25,7 +25,7 @@ public partial class LyricPreview : SettingsSubsectionPreview private readonly Bindable mainFont = new(); private readonly Bindable rubyFont = new(); private readonly Bindable romanisationFont = new(); - private readonly Bindable translateFont = new(); + private readonly Bindable translationFont = new(); private readonly Bindable preferLanguage = new(); [Resolved] @@ -64,13 +64,13 @@ public LyricPreview() { addFont(e.NewValue); }); - translateFont.BindValueChanged(e => + translationFont.BindValueChanged(e => { addFont(e.NewValue); }); preferLanguage.BindValueChanged(e => { - lyric.Translates = createPreviewTranslate(e.NewValue); + lyric.Translations = createPreviewTranslation(e.NewValue); }); void addFont(FontUsage fontUsage) @@ -95,8 +95,8 @@ private void load(FontManager fontManager, IRenderer renderer, KaraokeRulesetCon config.BindWith(KaraokeRulesetSetting.MainFont, mainFont); config.BindWith(KaraokeRulesetSetting.RubyFont, rubyFont); config.BindWith(KaraokeRulesetSetting.RomanisationFont, romanisationFont); - config.BindWith(KaraokeRulesetSetting.TranslateFont, translateFont); - config.BindWith(KaraokeRulesetSetting.PreferLanguage, preferLanguage); + config.BindWith(KaraokeRulesetSetting.TranslationFont, translationFont); + config.BindWith(KaraokeRulesetSetting.PreferTranslationLanguage, preferLanguage); } protected override void Dispose(bool isDisposing) @@ -143,9 +143,9 @@ private Lyric createPreviewLyric() EffectApplier = new PreviewLyricEffectApplier(), }; - private IDictionary createPreviewTranslate(CultureInfo cultureInfo) + private IDictionary createPreviewTranslation(CultureInfo cultureInfo) { - string translate = cultureInfo.Name switch + string translation = cultureInfo.Name switch { "ja" or "Ja-jp" => "カラオケ", "zh-Hant" or "zh-TW" => "卡拉OK", @@ -154,7 +154,7 @@ private IDictionary createPreviewTranslate(CultureInfo cult return new Dictionary { - { cultureInfo, translate }, + { cultureInfo, translation }, }; } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/ConfigSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/ConfigSection.cs index 391fae121..fa61bcaaa 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/ConfigSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/ConfigSection.cs @@ -23,7 +23,7 @@ public ConfigSection() { new GeneralSettings(), new NoteSettings(), - new TranslateSettings(), + new TranslationSettings(), new PracticeSettings(), }; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslationSettings.cs similarity index 79% rename from osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs rename to osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslationSettings.cs index a795993e8..f837b6eda 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslationSettings.cs @@ -11,9 +11,9 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Settings.Sections.Gameplay; -public partial class TranslateSettings : KaraokeSettingsSubsection +public partial class TranslationSettings : KaraokeSettingsSubsection { - protected override LocalisableString Header => "Translate"; + protected override LocalisableString Header => "Translation"; public override SettingsSubsectionPreview CreatePreview() => new LyricPreview(); @@ -25,8 +25,8 @@ private void load() new SettingsLanguage { LabelText = "Prefer language", - TooltipText = "Select prefer translate language.", - Current = Config.GetBindable(KaraokeRulesetSetting.PreferLanguage), + TooltipText = "Select prefer translation.", + Current = Config.GetBindable(KaraokeRulesetSetting.PreferTranslationLanguage), }, }; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Graphics/LyricFontSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Graphics/LyricFontSettings.cs index 752f86327..ddd3dfbe7 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Graphics/LyricFontSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Graphics/LyricFontSettings.cs @@ -58,14 +58,14 @@ private void load() }, new SettingsFont { - LabelText = "Translate font", - Current = Config.GetBindable(KaraokeRulesetSetting.TranslateFont), + LabelText = "Translation font", + Current = Config.GetBindable(KaraokeRulesetSetting.TranslationFont), }, new SettingsCheckbox { - LabelText = "Force use default translate font.", + LabelText = "Force use default translation font.", TooltipText = "Force use default font even has customize font in skin or beatmap.", - Current = Config.GetBindable(KaraokeRulesetSetting.ForceUseDefaultTranslateFont), + Current = Config.GetBindable(KaraokeRulesetSetting.ForceUseDefaultTranslationFont), }, }; } diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs b/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs index 45b694691..a14ceb652 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs @@ -115,10 +115,10 @@ public void ApplyTo(Drawable d) l.BottomTextMargin = RomanisationMargin; }); - // Apply translate font. - drawableLyric.ApplyToTranslateText(text => + // Apply translation font. + drawableLyric.ApplyToTranslationText(text => { - text.Font = getFont(KaraokeRulesetSetting.TranslateFont); + text.Font = getFont(KaraokeRulesetSetting.TranslationFont); }); FontUsage getFont(KaraokeRulesetSetting setting, FontUsage? skinFont = null) @@ -141,8 +141,8 @@ bool forceUseDefaultFont() case KaraokeRulesetSetting.RomanisationFont: return config?.Get(KaraokeRulesetSetting.ForceUseDefaultFont) ?? false; - case KaraokeRulesetSetting.TranslateFont: - return config?.Get(KaraokeRulesetSetting.ForceUseDefaultTranslateFont) ?? false; + case KaraokeRulesetSetting.TranslationFont: + return config?.Get(KaraokeRulesetSetting.ForceUseDefaultTranslationFont) ?? false; default: throw new InvalidOperationException(nameof(setting)); diff --git a/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs index 07929458c..0fcc9e523 100644 --- a/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs +++ b/osu.Game.Rulesets.Karaoke/UI/KaraokePlayfieldAdjustmentContainer.cs @@ -33,7 +33,7 @@ private void load(FontManager fontManager, IRenderer renderer, KaraokeRulesetCon manager.Get(KaraokeRulesetSetting.MainFont), manager.Get(KaraokeRulesetSetting.RubyFont), manager.Get(KaraokeRulesetSetting.RomanisationFont), - manager.Get(KaraokeRulesetSetting.TranslateFont), + manager.Get(KaraokeRulesetSetting.TranslationFont), manager.Get(KaraokeRulesetSetting.NoteFont), };