自动添加新控件的翻译
This commit is contained in:
@@ -21,7 +21,10 @@ namespace CleanMachineHMI.Utils
|
||||
/// </summary>
|
||||
public static class frmUtil
|
||||
{
|
||||
public static List<ThemeLanguage> znCNLang = new List<ThemeLanguage>();
|
||||
/// <summary>
|
||||
/// 新增的翻译
|
||||
/// </summary>
|
||||
public static List<ThemeLanguage> _newlyLang = new List<ThemeLanguage>();
|
||||
|
||||
/// <summary>
|
||||
/// 给一个字符串进行MD5加密
|
||||
@@ -351,20 +354,19 @@ namespace CleanMachineHMI.Utils
|
||||
return;
|
||||
}
|
||||
var codes = key.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (znCNLang.Any(x => x.formCode == codes[0] && x.controlCode == codes[1]))
|
||||
if (Global.ThemeLanguage.ContainsKey(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
znCNLang.Add(new ThemeLanguage
|
||||
_newlyLang.Add(new ThemeLanguage
|
||||
{
|
||||
formCode = codes[0],
|
||||
controlCode = codes[1],
|
||||
controlName = string.IsNullOrEmpty(options) ? name : null,
|
||||
options = string.IsNullOrEmpty(options) ? null : options.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(),
|
||||
});
|
||||
var str1 = Newtonsoft.Json.JsonConvert.SerializeObject(znCNLang);
|
||||
WriteLangFile("zh-CN.json", str1);
|
||||
var str1 = Newtonsoft.Json.JsonConvert.SerializeObject(_newlyLang);
|
||||
WriteLangFile("newly.json", str1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user