|
@@ -69,7 +69,7 @@ namespace PDF_Master.Helper
|
|
|
/// 翻译指定内容,可以指定语言
|
|
|
/// </summary>
|
|
|
/// <param name="content"></param>
|
|
|
- /// <param name="language">1=中文 2=英文 3=法语 4=汉语</param>
|
|
|
+ /// <param name="filename"></param>
|
|
|
/// <returns></returns>
|
|
|
public async static Task<string> fileKeyTranslate(string content, string filename)
|
|
|
{
|
|
@@ -510,7 +510,10 @@ namespace PDF_Master.Helper
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public static string Code = "";
|
|
|
+ /// <summary>
|
|
|
+ /// chatGPT错误码
|
|
|
+ /// </summary>
|
|
|
+ public static string ChatGPTCode = "";
|
|
|
|
|
|
/// <summary>
|
|
|
/// 从接口获取信息,获取message对应value值
|
|
@@ -535,8 +538,8 @@ namespace PDF_Master.Helper
|
|
|
App.mainWindowViewModel.Value = 8;
|
|
|
string unicode = "";
|
|
|
// 遍历字典对象输出键值对
|
|
|
- Code = jobject["code"].ToObject<string>().ToLower();
|
|
|
- if (Code == "200")
|
|
|
+ ChatGPTCode = jobject["code"].ToObject<string>().ToLower();
|
|
|
+ if (ChatGPTCode == "200")
|
|
|
{
|
|
|
unicode = jobject["data"][key].ToObject<string>().ToLower();
|
|
|
}
|
|
@@ -556,9 +559,9 @@ namespace PDF_Master.Helper
|
|
|
}
|
|
|
if (statusCode == 401)
|
|
|
{
|
|
|
- Code= "401";
|
|
|
+ ChatGPTCode= "401";
|
|
|
}
|
|
|
- else Code = "300";
|
|
|
+ else ChatGPTCode = "300";
|
|
|
clossProcess();
|
|
|
return null;
|
|
|
}
|
|
@@ -733,6 +736,27 @@ namespace PDF_Master.Helper
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 错误码
|
|
|
+
|
|
|
+ public static string GetBaiduTranslationCode(string code) {
|
|
|
+
|
|
|
+ if (!String.IsNullOrEmpty(App.HomePageLoader.GetString("BaiduTranslation" + code))) {
|
|
|
+ return App.HomePageLoader.GetString("BaiduTranslation" + code);
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static string GetChatGPTCode(string code)
|
|
|
+ {
|
|
|
+ if (!String.IsNullOrEmpty(App.HomePageLoader.GetString("ChatGTP" + code)))
|
|
|
+ {
|
|
|
+ return App.HomePageLoader.GetString("ChatGTP" + code);
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|
|
|
|