自动添加新控件的翻译

This commit is contained in:
dev
2022-05-24 09:58:10 +08:00
parent 80b9aab619
commit ab6f8874c5
3 changed files with 22 additions and 23 deletions

View File

@@ -335,20 +335,20 @@ namespace CleanMachineHMI
}
}
public static void LoadzhCN()
{
if (Utils.frmUtil.znCNLang == null || Utils.frmUtil.znCNLang.Count == 0)
{
var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0];
var filePath = appPath + $"Lang\\zh-CN.json";
if (!File.Exists(filePath))
{
return;
}
var str = File.ReadAllText(filePath);
Utils.frmUtil.znCNLang = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str);
//public static void LoadzhCN()
//{
// if (Utils.frmUtil.znCNLang == null || Utils.frmUtil.znCNLang.Count == 0)
// {
// var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0];
// var filePath = appPath + $"Lang\\zh-CN.json";
// if (!File.Exists(filePath))
// {
// return;
// }
// var str = File.ReadAllText(filePath);
// Utils.frmUtil.znCNLang = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str);
}
}
// }
//}
}
}