This commit is contained in:
Slnanx 2024-11-17 09:44:39 +00:00
parent 3b19bc1a76
commit ffb79bdcb8
2 changed files with 5 additions and 1 deletions

View file

@ -4,10 +4,12 @@
* 使
*
* :
* - System
* - System.Collections.Generic
* - System.Globalization
* - System.IO
* - System.Text.Json
* - System.Threading
*
* :
* - JSON文件en.jsonzh.json
@ -32,6 +34,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text.Json;
using System.Threading;
public class Localization
{
@ -71,6 +74,7 @@ public class Localization
catch (Exception ex)
{
Console.WriteLine($"Failed to load JSON file: {ex.Message}");
Thread.Sleep(5000);
Environment.Exit(1);
return false; // 读取或解析JSON文件失败
}

View file

@ -10,7 +10,7 @@
* - System.Text.Json
*
* :
* - JSON文件en.jsonzh.json
* - JSON文件en-US.jsonzh-CN.json
* - JSON文件放置程序同目录中
* -
* - localization.Translate("Try_Terminate_Process") //返回一个 string 字符串