[O] Locale

This commit is contained in:
Clansty
2024-10-27 23:56:26 +08:00
parent ff2ed50dea
commit 36da872932
7 changed files with 51 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
namespace AquaMai.Attributes;
[AttributeUsage(AttributeTargets.Class)]
public class GameVersionAttribute(uint minVersion = 0, uint maxVersion = 0) : Attribute
{
public uint MinVersion { get; } = minVersion;

View File

@@ -44,7 +44,7 @@ namespace AquaMai
{
if (!isNested)
{
MelonLogger.Warning($"> Skipping incompatible patch: {type}");
MelonLogger.Warning(string.Format(Locale.SkipIncompatiblePatch, type));
}
return;

View File

@@ -151,6 +151,15 @@ namespace AquaMai.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Repeat end time cannot be less than repeat start time.
/// </summary>
internal static string RepeatEndTimeLessThenStartTime {
get {
return ResourceManager.GetString("RepeatEndTimeLessThenStartTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loop Not Set.
/// </summary>
@@ -187,6 +196,15 @@ namespace AquaMai.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Please set repeat start time first.
/// </summary>
internal static string RepeatStartTimeNotSet {
get {
return ResourceManager.GetString("RepeatStartTimeNotSet", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Saving... Do not exit the game.
/// </summary>
@@ -223,6 +241,15 @@ namespace AquaMai.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to &gt; Skipping incompatible patch: {0}.
/// </summary>
internal static string SkipIncompatiblePatch {
get {
return ResourceManager.GetString("SkipIncompatiblePatch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Speed.
/// </summary>

View File

@@ -86,4 +86,13 @@
<data name="Skip" xml:space="preserve">
<value>Skip</value>
</data>
<data name="SkipIncompatiblePatch" xml:space="preserve">
<value>&gt; Skipping incompatible patch: {0}</value>
</data>
<data name="RepeatStartTimeNotSet" xml:space="preserve">
<value>Please set repeat start time first</value>
</data>
<data name="RepeatEndTimeLessThenStartTime" xml:space="preserve">
<value>Repeat end time cannot be less than repeat start time</value>
</data>
</root>

View File

@@ -79,4 +79,13 @@
<data name="Skip" xml:space="preserve">
<value>跳过</value>
</data>
<data name="SkipIncompatiblePatch" xml:space="preserve">
<value>&gt; 已跳过加载不兼容的功能: {0}</value>
</data>
<data name="RepeatEndTimeLessThenStartTime" xml:space="preserve">
<value>循环结束时间不能早于开始时间</value>
</data>
<data name="RepeatStartTimeNotSet" xml:space="preserve">
<value>请先设置循环开始时间</value>
</data>
</root>

View File

@@ -17,7 +17,7 @@ public class LoadLocalBga
var music = Singleton<DataManager>.Instance.GetMusic(GameManager.SelectMusicID[0]);
if (music is null) return;
var moviePath = string.Format(Singleton<OptionDataManager>.Instance.GetMovieDataPath($"{music.movieName.id:000000}") + ".dat");
var moviePath = Singleton<OptionDataManager>.Instance.GetMovieDataPath($"{music.movieName.id:000000}") + ".dat";
if (!moviePath.Contains("dummy")) return;
var jacket = LoadAssetsPng.GetJacketTexture2D(music.movieName.id);

View File

@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Reflection;
using AquaMai.Fix;
using AquaMai.Helpers;
using AquaMai.Resources;
using HarmonyLib;
using Manager;
using Monitor;
@@ -28,13 +29,13 @@ public class PractiseMode
{
if (repeatStart == -1)
{
MessageHelper.ShowMessage("Please set repeat start time first");
MessageHelper.ShowMessage(Locale.RepeatStartTimeNotSet);
return;
}
if (time < repeatStart)
{
MessageHelper.ShowMessage("Repeat end time cannot be less than repeat start time");
MessageHelper.ShowMessage(Locale.RepeatEndTimeLessThenStartTime);
return;
}