Skip to content

Commit

Permalink
add i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Feb 10, 2024
1 parent b8a5664 commit 14cd8c9
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ private async Task ProcessSvgCommand(GenerateOption opt)
}

_ = await IoC.Get<IPreviewSvgGenerator>().GenerateSvgAsync(fumen, opt);
Log.LogInfo($"生成谱面预览.svg文件成功");
Log.LogInfo(Resources.GenerateSvgSuccess);
}
catch (Exception e)
{
Log.LogError($"执行GenerateSvgAsync()出错", e);
Log.LogError(Resources.CallGenerateSvgAsyncFail, e);
}

Exit();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Caliburn.Micro;
using Gemini.Framework.Commands;
using Gemini.Framework.Threading;
using Mono.Cecil;
using OngekiFumenEditor.Modules.FumenVisualEditor.Kernel;
using OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels;
using OngekiFumenEditor.Modules.PreviewSvgGenerator.Commands.GenerateSvg;
using OngekiFumenEditor.Properties;
using OngekiFumenEditor.Utils;
using System;
using System.ComponentModel.Composition;
Expand Down Expand Up @@ -43,13 +45,13 @@ public override async Task Run(Command command)
OutputFilePath = Path.GetTempFileName() + ".svg"
};
await IoC.Get<IPreviewSvgGenerator>().GenerateSvgAsync(editor.Fumen, opt);
if (MessageBox.Show($"生成svg文件成功,是否立即打开文件?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
if (MessageBox.Show(Resources.GenerateSvgSuccessAndAskIfOpen, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
ProcessUtils.OpenPath(opt.OutputFilePath);

}
catch (Exception e)
{
MessageBox.Show($"生成svg文件失败:{e.Message}");
MessageBox.Show(Resources.CallGenerateSvgAsyncFail + e.Message);
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions OngekiFumenEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions OngekiFumenEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@
<data name="CallAcbGeneratorFuckFail" xml:space="preserve">
<value>Call AcbGeneratorFuck.Generator.Generate() failed</value>
</data>
<data name="CallGenerateSvgAsyncFail" xml:space="preserve">
<value>Call GenerateSvgAsync() failed</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
Expand Down Expand Up @@ -810,6 +813,12 @@
<data name="GenerateSvg" xml:space="preserve">
<value>Generate fumen preview .svg file</value>
</data>
<data name="GenerateSvgSuccess" xml:space="preserve">
<value>Fumen .svg file generated successfully</value>
</data>
<data name="GenerateSvgSuccessAndAskIfOpen" xml:space="preserve">
<value>Successfully generated .svg file. Do you want to open the file now?</value>
</data>
<data name="Genre" xml:space="preserve">
<value>Genre:</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions OngekiFumenEditor/Properties/Resources.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@
<data name="CallAcbGeneratorFuckFail" xml:space="preserve">
<value>调用AcbGeneratorFuck.Generator.Generate()失败</value>
</data>
<data name="CallGenerateSvgAsyncFail" xml:space="preserve">
<value>执行GenerateSvgAsync()出错</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>取消</value>
</data>
Expand Down Expand Up @@ -810,6 +813,12 @@
<data name="GenerateSvg" xml:space="preserve">
<value>生成铺面预览.svg文件</value>
</data>
<data name="GenerateSvgSuccess" xml:space="preserve">
<value>生成谱面预览.svg文件成功</value>
</data>
<data name="GenerateSvgSuccessAndAskIfOpen" xml:space="preserve">
<value>生成svg文件成功,是否立即打开文件?</value>
</data>
<data name="Genre" xml:space="preserve">
<value>音乐分类:</value>
</data>
Expand Down

0 comments on commit 14cd8c9

Please sign in to comment.