feat: spineview localize

This commit is contained in:
Myssal
2025-04-27 23:48:36 +07:00
parent ff87030894
commit 58b45cde31
2 changed files with 17 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
using System; using SpineViewer.Utils.Localize;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
@@ -48,13 +49,17 @@ namespace SpineViewer.Spine.SpineExporter
/// <summary> /// <summary>
/// 文件格式 /// 文件格式
/// </summary> /// </summary>
[Category("[2] FFmpeg "), DisplayName(""), Description("-f, ")] [LocalizedCategory(typeof(Properties.Resources), "categoryFFmpegParameter")]
[LocalizedDisplayName(typeof(Properties.Resources), "displayFileFormat")]
[LocalizedDescription(typeof(Properties.Resources), "descFileFormat")]
public string CustomFormat { get => Exporter.CustomFormat; set => Exporter.CustomFormat = value; } public string CustomFormat { get => Exporter.CustomFormat; set => Exporter.CustomFormat = value; }
/// <summary> /// <summary>
/// 文件名后缀 /// 文件名后缀
/// </summary> /// </summary>
[Category("[2] FFmpeg "), DisplayName(""), Description("")] [LocalizedCategory(typeof(Properties.Resources), "categoryFFmpegParameter")]
[LocalizedDisplayName(typeof(Properties.Resources), "displayFilenameSuffix")]
[LocalizedDescription(typeof(Properties.Resources), "descFilenameSuffix")]
public string CustomSuffix { get => Exporter.CustomSuffix; set => Exporter.CustomSuffix = value; } public string CustomSuffix { get => Exporter.CustomSuffix; set => Exporter.CustomSuffix = value; }
} }
} }

View File

@@ -288,11 +288,11 @@ namespace SpineViewer.Spine.SpineExporter
public virtual string? Validate() public virtual string? Validate()
{ {
if (!string.IsNullOrWhiteSpace(OutputDir) && File.Exists(OutputDir)) if (!string.IsNullOrWhiteSpace(OutputDir) && File.Exists(OutputDir))
return "输出文件夹无效"; return Properties.Resources.invalidInputFolder;
if (!string.IsNullOrWhiteSpace(OutputDir) && !Directory.Exists(OutputDir)) if (!string.IsNullOrWhiteSpace(OutputDir) && !Directory.Exists(OutputDir))
return $"文件夹 {OutputDir} 不存在"; return $"{Properties.Resources.folderNotExistPrefix} {OutputDir} {Properties.Resources.folderNotExistSuffix}";
if (IsExportSingle && string.IsNullOrWhiteSpace(OutputDir)) if (IsExportSingle && string.IsNullOrWhiteSpace(OutputDir))
return "导出单个时必须提供输出文件夹"; return Properties.Resources.mustProvideOutputFolder;
OutputDir = string.IsNullOrWhiteSpace(OutputDir) ? null : Path.GetFullPath(OutputDir); OutputDir = string.IsNullOrWhiteSpace(OutputDir) ? null : Path.GetFullPath(OutputDir);
return null; return null;