mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 20:33:21 +08:00
Localise part of editor
This commit is contained in:
parent
24df23f420
commit
78e562903d
164
osu.Game/Localisation/EditorStrings.cs
Normal file
164
osu.Game/Localisation/EditorStrings.cs
Normal file
@ -0,0 +1,164 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Localisation;
|
||||
|
||||
namespace osu.Game.Localisation
|
||||
{
|
||||
public static class EditorStrings
|
||||
{
|
||||
private const string prefix = @"osu.Game.Resources.Localisation.Editor";
|
||||
|
||||
/// <summary>
|
||||
/// "File"
|
||||
/// </summary>
|
||||
public static LocalisableString File => new TranslatableString(getKey(@"file"), @"File");
|
||||
|
||||
/// <summary>
|
||||
/// "Edit"
|
||||
/// </summary>
|
||||
public static LocalisableString Edit => new TranslatableString(getKey(@"edit"), @"Edit");
|
||||
|
||||
/// <summary>
|
||||
/// "Undo"
|
||||
/// </summary>
|
||||
public static LocalisableString Undo => new TranslatableString(getKey(@"undo"), @"Undo");
|
||||
|
||||
/// <summary>
|
||||
/// "Redo"
|
||||
/// </summary>
|
||||
public static LocalisableString Redo => new TranslatableString(getKey(@"redo"), @"Redo");
|
||||
|
||||
/// <summary>
|
||||
/// "Cut"
|
||||
/// </summary>
|
||||
public static LocalisableString Cut => new TranslatableString(getKey(@"cut"), @"Cut");
|
||||
|
||||
/// <summary>
|
||||
/// "Copy"
|
||||
/// </summary>
|
||||
public static LocalisableString Copy => new TranslatableString(getKey(@"copy"), @"Copy");
|
||||
|
||||
/// <summary>
|
||||
/// "Paste"
|
||||
/// </summary>
|
||||
public static LocalisableString Paste => new TranslatableString(getKey(@"paste"), @"Paste");
|
||||
|
||||
/// <summary>
|
||||
/// "Clone"
|
||||
/// </summary>
|
||||
public static LocalisableString Clone => new TranslatableString(getKey(@"clone"), @"Clone");
|
||||
|
||||
/// <summary>
|
||||
/// "View"
|
||||
/// </summary>
|
||||
public static LocalisableString View => new TranslatableString(getKey(@"view"), @"View");
|
||||
|
||||
/// <summary>
|
||||
/// "Background dim"
|
||||
/// </summary>
|
||||
public static LocalisableString BackgroundDim => new TranslatableString(getKey(@"background_dim"), @"Background dim");
|
||||
|
||||
/// <summary>
|
||||
/// "Waveform opacity"
|
||||
/// </summary>
|
||||
public static LocalisableString WaveformOpacity => new TranslatableString(getKey(@"waveform_opacity"), @"Waveform opacity");
|
||||
|
||||
/// <summary>
|
||||
/// "Show hit markers"
|
||||
/// </summary>
|
||||
public static LocalisableString ShowHitMarkers => new TranslatableString(getKey(@"show_hit_markers"), @"Show hit markers");
|
||||
|
||||
/// <summary>
|
||||
/// "Timing"
|
||||
/// </summary>
|
||||
public static LocalisableString Timing => new TranslatableString(getKey(@"timing"), @"Timing");
|
||||
|
||||
/// <summary>
|
||||
/// "Set preview point to current time"
|
||||
/// </summary>
|
||||
public static LocalisableString SetPreviewPointToCurrent => new TranslatableString(getKey(@"set_preview_point_to_current"), @"Set preview point to current time");
|
||||
|
||||
/// <summary>
|
||||
/// "Save"
|
||||
/// </summary>
|
||||
public static LocalisableString Save => new TranslatableString(getKey(@"save"), @"Save");
|
||||
|
||||
/// <summary>
|
||||
/// "Export package"
|
||||
/// </summary>
|
||||
public static LocalisableString ExportPackage => new TranslatableString(getKey(@"export_package"), @"Export package");
|
||||
|
||||
/// <summary>
|
||||
/// "Create new difficulty"
|
||||
/// </summary>
|
||||
public static LocalisableString CreateNewDifficulty => new TranslatableString(getKey(@"create_new_difficulty"), @"Create new difficulty");
|
||||
|
||||
/// <summary>
|
||||
/// "Change difficulty"
|
||||
/// </summary>
|
||||
public static LocalisableString ChangeDifficulty => new TranslatableString(getKey(@"change_difficulty"), @"Change difficulty");
|
||||
|
||||
/// <summary>
|
||||
/// "Delete difficulty"
|
||||
/// </summary>
|
||||
public static LocalisableString DeleteDifficulty => new TranslatableString(getKey(@"delete_difficulty"), @"Delete difficulty");
|
||||
|
||||
/// <summary>
|
||||
/// "Exit"
|
||||
/// </summary>
|
||||
public static LocalisableString Exit => new TranslatableString(getKey(@"exit"), @"Exit");
|
||||
|
||||
/// <summary>
|
||||
/// "setup"
|
||||
/// </summary>
|
||||
public static LocalisableString SetupScreen => new TranslatableString(getKey(@"setup_screen"), @"setup");
|
||||
|
||||
/// <summary>
|
||||
/// "compose"
|
||||
/// </summary>
|
||||
public static LocalisableString ComposeScreen => new TranslatableString(getKey(@"compose_screen"), @"compose");
|
||||
|
||||
/// <summary>
|
||||
/// "design"
|
||||
/// </summary>
|
||||
public static LocalisableString DesignScreen => new TranslatableString(getKey(@"design_screen"), @"design");
|
||||
|
||||
/// <summary>
|
||||
/// "timing"
|
||||
/// </summary>
|
||||
public static LocalisableString TimingScreen => new TranslatableString(getKey(@"timing_screen"), @"timing");
|
||||
|
||||
/// <summary>
|
||||
/// "verify"
|
||||
/// </summary>
|
||||
public static LocalisableString VerifyScreen => new TranslatableString(getKey(@"verify_screen"), @"verify");
|
||||
|
||||
/// <summary>
|
||||
/// "Playback speed"
|
||||
/// </summary>
|
||||
public static LocalisableString PlaybackSpeed => new TranslatableString(getKey(@"playback_speed"), @"Playback speed");
|
||||
|
||||
/// <summary>
|
||||
/// "Test!"
|
||||
/// </summary>
|
||||
public static LocalisableString TestBeatmap => new TranslatableString(getKey(@"test_beatmap"), @"Test!");
|
||||
|
||||
/// <summary>
|
||||
/// "Waveform"
|
||||
/// </summary>
|
||||
public static LocalisableString TimelineWaveform => new TranslatableString(getKey(@"timeline_waveform"), @"Waveform");
|
||||
|
||||
/// <summary>
|
||||
/// "Ticks"
|
||||
/// </summary>
|
||||
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
|
||||
|
||||
/// <summary>
|
||||
/// "BPM"
|
||||
/// </summary>
|
||||
public static LocalisableString TimelineBpm => new TranslatableString(getKey(@"timeline_bpm"), @"BPM");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
@ -5,17 +5,18 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
internal class BackgroundDimMenuItem : MenuItem
|
||||
{
|
||||
private readonly Bindable<float> backgroudDim;
|
||||
private readonly Bindable<float> backgroundDim;
|
||||
|
||||
private readonly Dictionary<float, TernaryStateRadioMenuItem> menuItemLookup = new Dictionary<float, TernaryStateRadioMenuItem>();
|
||||
|
||||
public BackgroundDimMenuItem(Bindable<float> backgroudDim)
|
||||
: base("Background dim")
|
||||
public BackgroundDimMenuItem(Bindable<float> backgroundDim)
|
||||
: base(EditorStrings.BackgroundDim)
|
||||
{
|
||||
Items = new[]
|
||||
{
|
||||
@ -25,8 +26,8 @@ namespace osu.Game.Screens.Edit
|
||||
createMenuItem(0.75f),
|
||||
};
|
||||
|
||||
this.backgroudDim = backgroudDim;
|
||||
backgroudDim.BindValueChanged(dim =>
|
||||
this.backgroundDim = backgroundDim;
|
||||
backgroundDim.BindValueChanged(dim =>
|
||||
{
|
||||
foreach (var kvp in menuItemLookup)
|
||||
kvp.Value.State.Value = kvp.Key == dim.NewValue ? TernaryState.True : TernaryState.False;
|
||||
@ -40,6 +41,6 @@ namespace osu.Game.Screens.Edit
|
||||
return item;
|
||||
}
|
||||
|
||||
private void updateOpacity(float dim) => backgroudDim.Value = dim;
|
||||
private void updateOpacity(float dim) => backgroundDim.Value = dim;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -47,7 +48,7 @@ namespace osu.Game.Screens.Edit.Components
|
||||
new OsuSpriteText
|
||||
{
|
||||
Origin = Anchor.BottomLeft,
|
||||
Text = "Playback speed",
|
||||
Text = EditorStrings.PlaybackSpeed,
|
||||
RelativePositionAxes = Axes.Y,
|
||||
Y = 0.5f,
|
||||
Padding = new MarginPadding { Left = 45 }
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
|
||||
Content.CornerRadius = 0;
|
||||
|
||||
Text = "Test!";
|
||||
Text = EditorStrings.TestBeatmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
|
||||
@ -75,17 +76,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
{
|
||||
waveformCheckbox = new OsuCheckbox
|
||||
{
|
||||
LabelText = "Waveform",
|
||||
LabelText = EditorStrings.TimelineWaveform,
|
||||
Current = { Value = true },
|
||||
},
|
||||
ticksCheckbox = new OsuCheckbox
|
||||
{
|
||||
LabelText = "Ticks",
|
||||
LabelText = EditorStrings.TimelineTicks,
|
||||
Current = { Value = true },
|
||||
},
|
||||
controlPointsCheckbox = new OsuCheckbox
|
||||
{
|
||||
LabelText = "BPM",
|
||||
LabelText = EditorStrings.TimelineBpm,
|
||||
Current = { Value = true },
|
||||
},
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ using osu.Game.Screens.Edit.Verify;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
using CommonStrings = osu.Game.Resources.Localisation.Web.CommonStrings;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
@ -294,40 +293,40 @@ namespace osu.Game.Screens.Edit
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Items = new[]
|
||||
{
|
||||
new MenuItem("File")
|
||||
new MenuItem(EditorStrings.File)
|
||||
{
|
||||
Items = createFileMenuItems()
|
||||
},
|
||||
new MenuItem(CommonStrings.ButtonsEdit)
|
||||
new MenuItem(EditorStrings.Edit)
|
||||
{
|
||||
Items = new[]
|
||||
{
|
||||
undoMenuItem = new EditorMenuItem("Undo", MenuItemType.Standard, Undo),
|
||||
redoMenuItem = new EditorMenuItem("Redo", MenuItemType.Standard, Redo),
|
||||
undoMenuItem = new EditorMenuItem(EditorStrings.Undo, MenuItemType.Standard, Undo),
|
||||
redoMenuItem = new EditorMenuItem(EditorStrings.Redo, MenuItemType.Standard, Redo),
|
||||
new EditorMenuItemSpacer(),
|
||||
cutMenuItem = new EditorMenuItem("Cut", MenuItemType.Standard, Cut),
|
||||
copyMenuItem = new EditorMenuItem("Copy", MenuItemType.Standard, Copy),
|
||||
pasteMenuItem = new EditorMenuItem("Paste", MenuItemType.Standard, Paste),
|
||||
cloneMenuItem = new EditorMenuItem("Clone", MenuItemType.Standard, Clone),
|
||||
cutMenuItem = new EditorMenuItem(EditorStrings.Cut, MenuItemType.Standard, Cut),
|
||||
copyMenuItem = new EditorMenuItem(EditorStrings.Copy, MenuItemType.Standard, Copy),
|
||||
pasteMenuItem = new EditorMenuItem(EditorStrings.Paste, MenuItemType.Standard, Paste),
|
||||
cloneMenuItem = new EditorMenuItem(EditorStrings.Clone, MenuItemType.Standard, Clone),
|
||||
}
|
||||
},
|
||||
new MenuItem("View")
|
||||
new MenuItem(EditorStrings.View)
|
||||
{
|
||||
Items = new MenuItem[]
|
||||
{
|
||||
new WaveformOpacityMenuItem(config.GetBindable<float>(OsuSetting.EditorWaveformOpacity)),
|
||||
new BackgroundDimMenuItem(editorBackgroundDim),
|
||||
new ToggleMenuItem("Show hit markers")
|
||||
new ToggleMenuItem(EditorStrings.ShowHitMarkers)
|
||||
{
|
||||
State = { BindTarget = editorHitMarkers },
|
||||
}
|
||||
}
|
||||
},
|
||||
new MenuItem("Timing")
|
||||
new MenuItem(EditorStrings.Timing)
|
||||
{
|
||||
Items = new MenuItem[]
|
||||
{
|
||||
new EditorMenuItem("Set preview point to current time", MenuItemType.Standard, SetPreviewPointToCurrentTime)
|
||||
new EditorMenuItem(EditorStrings.SetPreviewPointToCurrent, MenuItemType.Standard, SetPreviewPointToCurrentTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -716,7 +715,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
if (!(refetchedBeatmap is DummyWorkingBeatmap))
|
||||
{
|
||||
Logger.Log("Editor providing re-fetched beatmap post edit session");
|
||||
Logger.Log(@"Editor providing re-fetched beatmap post edit session");
|
||||
Beatmap.Value = refetchedBeatmap;
|
||||
}
|
||||
}
|
||||
@ -952,15 +951,15 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private List<MenuItem> createFileMenuItems() => new List<MenuItem>
|
||||
{
|
||||
new EditorMenuItem("Save", MenuItemType.Standard, () => Save()),
|
||||
new EditorMenuItem("Export package", MenuItemType.Standard, exportBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
|
||||
new EditorMenuItem(EditorStrings.Save, MenuItemType.Standard, () => Save()),
|
||||
new EditorMenuItem(EditorStrings.ExportPackage, MenuItemType.Standard, exportBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
|
||||
new EditorMenuItemSpacer(),
|
||||
createDifficultyCreationMenu(),
|
||||
createDifficultySwitchMenu(),
|
||||
new EditorMenuItemSpacer(),
|
||||
new EditorMenuItem("Delete difficulty", MenuItemType.Standard, deleteDifficulty) { Action = { Disabled = Beatmap.Value.BeatmapSetInfo.Beatmaps.Count < 2 } },
|
||||
new EditorMenuItem(EditorStrings.DeleteDifficulty, MenuItemType.Standard, deleteDifficulty) { Action = { Disabled = Beatmap.Value.BeatmapSetInfo.Beatmaps.Count < 2 } },
|
||||
new EditorMenuItemSpacer(),
|
||||
new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit)
|
||||
new EditorMenuItem(EditorStrings.Exit, MenuItemType.Standard, this.Exit)
|
||||
};
|
||||
|
||||
private void exportBeatmap()
|
||||
@ -1009,7 +1008,7 @@ namespace osu.Game.Screens.Edit
|
||||
foreach (var ruleset in rulesets.AvailableRulesets)
|
||||
rulesetItems.Add(new EditorMenuItem(ruleset.Name, MenuItemType.Standard, () => CreateNewDifficulty(ruleset)));
|
||||
|
||||
return new EditorMenuItem("Create new difficulty") { Items = rulesetItems };
|
||||
return new EditorMenuItem(EditorStrings.CreateNewDifficulty) { Items = rulesetItems };
|
||||
}
|
||||
|
||||
protected void CreateNewDifficulty(RulesetInfo rulesetInfo)
|
||||
@ -1045,7 +1044,7 @@ namespace osu.Game.Screens.Edit
|
||||
}
|
||||
}
|
||||
|
||||
return new EditorMenuItem("Change difficulty") { Items = difficultyItems };
|
||||
return new EditorMenuItem(EditorStrings.ChangeDifficulty) { Items = difficultyItems };
|
||||
}
|
||||
|
||||
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleSwitchToExistingDifficulty(nextBeatmap, GetState(nextBeatmap.Ruleset));
|
||||
|
@ -1,27 +1,26 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.ComponentModel;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
public enum EditorScreenMode
|
||||
{
|
||||
[Description("setup")]
|
||||
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.SetupScreen))]
|
||||
SongSetup,
|
||||
|
||||
[Description("compose")]
|
||||
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.ComposeScreen))]
|
||||
Compose,
|
||||
|
||||
[Description("design")]
|
||||
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.DesignScreen))]
|
||||
Design,
|
||||
|
||||
[Description("timing")]
|
||||
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.TimingScreen))]
|
||||
Timing,
|
||||
|
||||
[Description("verify")]
|
||||
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.VerifyScreen))]
|
||||
Verify,
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
@ -17,7 +18,7 @@ namespace osu.Game.Screens.Edit
|
||||
private readonly Dictionary<float, TernaryStateRadioMenuItem> menuItemLookup = new Dictionary<float, TernaryStateRadioMenuItem>();
|
||||
|
||||
public WaveformOpacityMenuItem(Bindable<float> waveformOpacity)
|
||||
: base("Waveform opacity")
|
||||
: base(EditorStrings.WaveformOpacity)
|
||||
{
|
||||
Items = new[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user