feat: messagebox title localize
This commit is contained in:
@@ -224,7 +224,7 @@ namespace SpineViewer.Controls
|
|||||||
{
|
{
|
||||||
if (validPaths.Count > 100)
|
if (validPaths.Count > 100)
|
||||||
{
|
{
|
||||||
if (MessagePopup.Quest($"{Properties.Resources.loadAllSkeletonPrefix}{validPaths.Count}{Properties.Resources.loadAllSkeletonSuffix}") == DialogResult.Cancel)
|
if (MessagePopup.Quest($"{Properties.Resources.loadAllSkeletonPrefix}{validPaths.Count}{Properties.Resources.loadAllSkeletonSuffix}", Properties.Resources.msgBoxQuest) == DialogResult.Cancel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BatchAdd(new Dialogs.BatchOpenSpineDialogResult(SpineVersion.Auto, validPaths.ToArray()));
|
BatchAdd(new Dialogs.BatchOpenSpineDialogResult(SpineVersion.Auto, validPaths.ToArray()));
|
||||||
@@ -413,7 +413,7 @@ namespace SpineViewer.Controls
|
|||||||
|
|
||||||
if (listView.SelectedIndices.Count > 1)
|
if (listView.SelectedIndices.Count > 1)
|
||||||
{
|
{
|
||||||
if (MessagePopup.Quest($"{Properties.Resources.removeItemConfirmPrefix} {listView.SelectedIndices.Count} {Properties.Resources.removeItemConfirmSuffix}") != DialogResult.OK)
|
if (MessagePopup.Quest($"{Properties.Resources.removeItemConfirmPrefix} {listView.SelectedIndices.Count} {Properties.Resources.removeItemConfirmSuffix}", Properties.Resources.msgBoxQuest) != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,7 +513,7 @@ namespace SpineViewer.Controls
|
|||||||
if (listView.Items.Count <= 0)
|
if (listView.Items.Count <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (MessagePopup.Quest($"{Properties.Resources.removeAllItemPrefix} {listView.Items.Count} {Properties.Resources.removeItemConfirmSuffix}") != DialogResult.OK)
|
if (MessagePopup.Quest($"{Properties.Resources.removeAllItemPrefix} {listView.Items.Count} {Properties.Resources.removeItemConfirmSuffix}", Properties.Resources.msgBoxQuest) != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
listView.Items.Clear();
|
listView.Items.Clear();
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ namespace SpineViewer.Controls
|
|||||||
{
|
{
|
||||||
logger.Fatal(ex.ToString());
|
logger.Fatal(ex.ToString());
|
||||||
logger.Fatal("Render task stopped");
|
logger.Fatal("Render task stopped");
|
||||||
MessagePopup.Error(ex.ToString(), "预览画面已停止渲染");
|
MessagePopup.Error(ex.ToString(), "预览画面已停止渲染", Properties.Resources.msgBoxError);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace SpineViewer.Dialogs
|
|||||||
|
|
||||||
if (items.Count <= 0)
|
if (items.Count <= 0)
|
||||||
{
|
{
|
||||||
MessagePopup.Info("未选择任何文件");
|
MessagePopup.Info("未选择任何文件", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +44,14 @@ namespace SpineViewer.Dialogs
|
|||||||
{
|
{
|
||||||
if (!File.Exists(p))
|
if (!File.Exists(p))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{p}", "skel文件不存在");
|
MessagePopup.Info($"{p}", Properties.Resources.skelNotExist);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version != SpineVersion.Auto && !Spine.SpineObject.HasImplementation(version))
|
if (version != SpineVersion.Auto && !Spine.SpineObject.HasImplementation(version))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{version.GetName()} 版本尚未实现(咕咕咕~)");
|
MessagePopup.Info($"{version.GetName()} 版本尚未实现(咕咕咕~)", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace SpineViewer.Dialogs
|
|||||||
|
|
||||||
if (items.Count <= 0)
|
if (items.Count <= 0)
|
||||||
{
|
{
|
||||||
MessagePopup.Info("未选择任何文件");
|
MessagePopup.Info("未选择任何文件", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ namespace SpineViewer.Dialogs
|
|||||||
outputDir = Path.GetFullPath(outputDir);
|
outputDir = Path.GetFullPath(outputDir);
|
||||||
if (!Directory.Exists(outputDir))
|
if (!Directory.Exists(outputDir))
|
||||||
{
|
{
|
||||||
if (MessagePopup.Quest("输出文件夹不存在,是否创建?") == DialogResult.OK)
|
if (MessagePopup.Quest("输出文件夹不存在,是否创建?", Properties.Resources.msgBoxQuest) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -82,7 +82,7 @@ namespace SpineViewer.Dialogs
|
|||||||
{
|
{
|
||||||
logger.Error(ex.ToString());
|
logger.Error(ex.ToString());
|
||||||
logger.Error("Failed to create output dir {}", outputDir);
|
logger.Error("Failed to create output dir {}", outputDir);
|
||||||
MessagePopup.Error(ex.ToString());
|
MessagePopup.Error(ex.ToString(), Properties.Resources.msgBoxError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,20 +97,20 @@ namespace SpineViewer.Dialogs
|
|||||||
{
|
{
|
||||||
if (!File.Exists(p))
|
if (!File.Exists(p))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{p}", "skel文件不存在");
|
MessagePopup.Info($"{p}", Properties.Resources.skelNotExist);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sourceVersion != SpineVersion.Auto && !SkeletonConverter.HasImplementation(sourceVersion))
|
if (sourceVersion != SpineVersion.Auto && !SkeletonConverter.HasImplementation(sourceVersion))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{sourceVersion.GetName()} 版本尚未实现(咕咕咕~)");
|
MessagePopup.Info($"{sourceVersion.GetName()} 版本尚未实现(咕咕咕~)", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SkeletonConverter.HasImplementation(targetVersion))
|
if (!SkeletonConverter.HasImplementation(targetVersion))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{targetVersion.GetName()} 版本尚未实现(咕咕咕~)");
|
MessagePopup.Info($"{targetVersion.GetName()} 版本尚未实现(咕咕咕~)", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace SpineViewer.Dialogs
|
|||||||
var properties = selectedObject.GetType().GetProperties();
|
var properties = selectedObject.GetType().GetProperties();
|
||||||
var result = string.Join(Environment.NewLine, properties.Select(p => $"{p.Name}\t{p.GetValue(selectedObject)?.ToString()}"));
|
var result = string.Join(Environment.NewLine, properties.Select(p => $"{p.Name}\t{p.GetValue(selectedObject)?.ToString()}"));
|
||||||
Clipboard.SetText(result);
|
Clipboard.SetText(result);
|
||||||
MessagePopup.Info("已复制");
|
MessagePopup.Info("已复制", Properties.Resources.msgBoxInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace SpineViewer.Dialogs
|
|||||||
{
|
{
|
||||||
if (wrapper.Exporter.Validate() is string error)
|
if (wrapper.Exporter.Validate() is string error)
|
||||||
{
|
{
|
||||||
MessagePopup.Info(error, "参数错误");
|
MessagePopup.Info(error, Properties.Resources.parameterError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace SpineViewer.Dialogs
|
|||||||
|
|
||||||
if (!File.Exists(skelPath))
|
if (!File.Exists(skelPath))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{skelPath}", "skel文件不存在");
|
MessagePopup.Info($"{skelPath}", Properties.Resources.skelNotExist);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -72,7 +72,7 @@ namespace SpineViewer.Dialogs
|
|||||||
}
|
}
|
||||||
else if (!File.Exists(atlasPath))
|
else if (!File.Exists(atlasPath))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{atlasPath}", "atlas文件不存在");
|
MessagePopup.Info($"{atlasPath}", Properties.Resources.atlasNotExist);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -82,7 +82,7 @@ namespace SpineViewer.Dialogs
|
|||||||
|
|
||||||
if (version != SpineVersion.Auto && !Spine.SpineObject.HasImplementation(version))
|
if (version != SpineVersion.Auto && !Spine.SpineObject.HasImplementation(version))
|
||||||
{
|
{
|
||||||
MessagePopup.Info($"{version.GetName()} 版本尚未实现(咕咕咕~)");
|
MessagePopup.Info($"{version.GetName()} 版本尚未实现(咕咕咕~)", Properties.Resources.msgBoxInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace SpineViewer.Dialogs
|
|||||||
if (e.Error != null)
|
if (e.Error != null)
|
||||||
{
|
{
|
||||||
logger.Error(e.Error.ToString());
|
logger.Error(e.Error.ToString());
|
||||||
MessagePopup.Error(e.Error.ToString(), "执行出错");
|
MessagePopup.Error(e.Error.ToString(), "执行出错", Properties.Resources.msgBoxError);
|
||||||
DialogResult = DialogResult.Abort;
|
DialogResult = DialogResult.Abort;
|
||||||
}
|
}
|
||||||
else if (e.Cancelled)
|
else if (e.Cancelled)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace SpineViewer
|
|||||||
{
|
{
|
||||||
logger.Error(ex.ToString());
|
logger.Error(ex.ToString());
|
||||||
logger.Error("Failed to load fragment shader");
|
logger.Error("Failed to load fragment shader");
|
||||||
MessagePopup.Warn("Fragment shader 加载失败,预乘Alpha通道属性失效");
|
MessagePopup.Warn("Fragment shader 加载失败,预乘Alpha通道属性失效", Properties.Resources.msgBoxWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@@ -103,7 +103,7 @@ namespace SpineViewer
|
|||||||
|
|
||||||
private void toolStripMenuItem_ExportFrame_Click(object sender, EventArgs e)
|
private void toolStripMenuItem_ExportFrame_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (spinePreviewPanel.IsUpdating && MessagePopup.Quest("画面仍在更新,建议手动暂停画面后导出固定的一帧,是否继续?") != DialogResult.OK)
|
if (spinePreviewPanel.IsUpdating && MessagePopup.Quest("画面仍在更新,建议手动暂停画面后导出固定的一帧,是否继续?", Properties.Resources.msgBoxQuest) != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var k = nameof(toolStripMenuItem_ExportFrame);
|
var k = nameof(toolStripMenuItem_ExportFrame);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace SpineViewer
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.Fatal(ex.ToString());
|
logger.Fatal(ex.ToString());
|
||||||
MessagePopup.Error(ex.ToString(), "程序已崩溃");
|
MessagePopup.Error(ex.ToString(), "程序已崩溃", Properties.Resources.msgBoxError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
27
SpineViewer/Properties/Resources.Designer.cs
generated
27
SpineViewer/Properties/Resources.Designer.cs
generated
@@ -69,6 +69,15 @@ namespace SpineViewer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to atlas文件不存在.
|
||||||
|
/// </summary>
|
||||||
|
internal static string atlasNotExist {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("atlasNotExist", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to 自定义.
|
/// Looks up a localized string similar to 自定义.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -330,6 +339,15 @@ namespace SpineViewer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to 参数错误.
|
||||||
|
/// </summary>
|
||||||
|
internal static string parameterError {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("parameterError", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to 已处理 .
|
/// Looks up a localized string similar to 已处理 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -383,5 +401,14 @@ namespace SpineViewer.Properties {
|
|||||||
return ResourceManager.GetString("restartTitle", resourceCulture);
|
return ResourceManager.GetString("restartTitle", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to skel文件不存在.
|
||||||
|
/// </summary>
|
||||||
|
internal static string skelNotExist {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("skelNotExist", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,9 @@
|
|||||||
<data name="about" xml:space="preserve">
|
<data name="about" xml:space="preserve">
|
||||||
<value>About</value>
|
<value>About</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="atlasNotExist" xml:space="preserve">
|
||||||
|
<value>Atlas file doesn't exist.</value>
|
||||||
|
</data>
|
||||||
<data name="categoryCustom" xml:space="preserve">
|
<data name="categoryCustom" xml:space="preserve">
|
||||||
<value>Custom</value>
|
<value>Custom</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -207,6 +210,9 @@
|
|||||||
<data name="notifyCopyGithubLink" xml:space="preserve">
|
<data name="notifyCopyGithubLink" xml:space="preserve">
|
||||||
<value>Link copied to clipboard. Please open it in browser</value>
|
<value>Link copied to clipboard. Please open it in browser</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="parameterError" xml:space="preserve">
|
||||||
|
<value>Invalid Parameters</value>
|
||||||
|
</data>
|
||||||
<data name="process" xml:space="preserve">
|
<data name="process" xml:space="preserve">
|
||||||
<value>Processed </value>
|
<value>Processed </value>
|
||||||
</data>
|
</data>
|
||||||
@@ -225,4 +231,7 @@
|
|||||||
<data name="restartTitle" xml:space="preserve">
|
<data name="restartTitle" xml:space="preserve">
|
||||||
<value>Application restart required!</value>
|
<value>Application restart required!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="skelNotExist" xml:space="preserve">
|
||||||
|
<value>Skel file doesn't exist.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -120,6 +120,9 @@
|
|||||||
<data name="about" xml:space="preserve">
|
<data name="about" xml:space="preserve">
|
||||||
<value>关于 </value>
|
<value>关于 </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="atlasNotExist" xml:space="preserve">
|
||||||
|
<value>atlas文件不存在</value>
|
||||||
|
</data>
|
||||||
<data name="categoryCustom" xml:space="preserve">
|
<data name="categoryCustom" xml:space="preserve">
|
||||||
<value>自定义</value>
|
<value>自定义</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -207,6 +210,9 @@
|
|||||||
<data name="notifyCopyGithubLink" xml:space="preserve">
|
<data name="notifyCopyGithubLink" xml:space="preserve">
|
||||||
<value>链接已复制到剪贴板,请前往浏览器进行访问</value>
|
<value>链接已复制到剪贴板,请前往浏览器进行访问</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="parameterError" xml:space="preserve">
|
||||||
|
<value>参数错误</value>
|
||||||
|
</data>
|
||||||
<data name="process" xml:space="preserve">
|
<data name="process" xml:space="preserve">
|
||||||
<value>已处理 </value>
|
<value>已处理 </value>
|
||||||
</data>
|
</data>
|
||||||
@@ -225,4 +231,7 @@
|
|||||||
<data name="restartTitle" xml:space="preserve">
|
<data name="restartTitle" xml:space="preserve">
|
||||||
<value>需要重新启动应用程序!</value>
|
<value>需要重新启动应用程序!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="skelNotExist" xml:space="preserve">
|
||||||
|
<value>skel文件不存在</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user