国际化修改

Uat_Study
he 2023-05-05 10:04:15 +08:00
parent 18dfc3ca37
commit 97d5010f0c
8 changed files with 86 additions and 18 deletions

View File

@ -74,7 +74,8 @@ namespace IRaCIS.Application.Services.BusinessFilter
else if(statusCode != 200&&!(objectResult.Value is IResponseOutput))
{
var apiResponse = ResponseOutput.NotOk("Program error, please contact developer.");
//---程序错误,请联系开发人员。
var apiResponse = ResponseOutput.NotOk(StaticData.International("UnifiedAPI_ProgramError"));
objectResult.Value = apiResponse;
objectResult.DeclaredType = apiResponse.GetType();
@ -114,4 +115,4 @@ namespace IRaCIS.Application.Services.BusinessFilter
return false;
}
}
}
}

View File

@ -93,14 +93,16 @@ public static class FileStoreHelper
if (systemClinicalData == null || systemClinicalData.Path == string.Empty)
{
throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。");
//---数据库没有找到对应的数据模板文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound"));
}
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, systemClinicalData.Path);
if (!System.IO.File.Exists(filePath))
{
throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。");
//---数据模板文件存储路径上未找对应文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid"));
}
return (filePath, systemClinicalData.FileName);
@ -121,14 +123,16 @@ public static class FileStoreHelper
if (trialClinicalData == null|| trialClinicalData.Path==string.Empty)
{
throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。");
//---数据库没有找到对应的数据模板文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound"));
}
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, trialClinicalData.Path);
if (!System.IO.File.Exists(filePath))
{
throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。");
//---数据模板文件存储路径上未找对应文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid"));
}
return (filePath, trialClinicalData.FileName);
@ -143,14 +147,16 @@ public static class FileStoreHelper
if (doc == null)
{
throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。");
//---数据库没有找到对应的数据模板文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound"));
}
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, doc.Path);
if (!System.IO.File.Exists(filePath))
{
throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。");
//---数据模板文件存储路径上未找对应文件,请联系系统运维人员。
throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid"));
}
return (filePath, doc.Name.Trim('/'));

View File

@ -42,7 +42,8 @@ public static class SendEmailHelper
catch (Exception ex)
{
throw new Exception("邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员");
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
throw new Exception(StaticData.International("SendEmail_SendFail"));
}
@ -62,7 +63,8 @@ public static class SendEmailHelper
if (sMTPEmailConfig.ToMailAddressList.Count == 0)
{
throw new ArgumentException("没有收件人");
//---没有收件人
throw new ArgumentException(StaticData.International("SendEmail_NoRecipient"));
}
else
{

View File

@ -507,7 +507,7 @@
//SubjectVisitFinalVisitTrigger
"SubjectVisit_CannotSetAsLastVisit": "The subject's follow-up visits has uploaded images or submitted , and the current visit is not allowed to be set as the last visit.",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
// ------------------------------------------------------------BusinessFilter--------------------------------------------------------------------
//LimitUserRequestAuthorization
"LimitUser_AuthTokenMissing": "User token was not retrieved from Header/URL, please contact developer",
"LimitUser_AccountLoggedInElsewhere": "User token was not retrieved from Header/URL, please contact developer",
@ -522,6 +522,14 @@
"TrialResource_InterceptedProjectStatusRule": "This request was blocked by configured rules: only operations allowed when project status is in progress, please contact developer if this logic is incorrect and needs to be modified",
"TrialResource_MissingProjectNumber": "Project number not passed in the API parameters, please verify.",
//UnifiedApiResultFilter
"UnifiedAPI_ProgramError": "Program error, please contact developer."
"UnifiedAPI_ProgramError": "Program error, please contact developer.",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
//FileStoreHelper
"FileStore_TemplateFileNotFound": "Database did not find the corresponding data template file for FileStoreHelper, please contact system maintenance personnel.",
"FileStore_TemplateFileStoragePathInvalid": "No corresponding file was found on the storage path for the data template file of FileStoreHelper, please contact system maintenance personnel.",
//SendEmailHelper
"SendEmail_SendFail": "Failed to send email in SendEmailHelper. Your operation was unsuccessful, please check your email or contact maintenance personnel.",
"SendEmail_NoRecipient": "No recipient in SendEmailHelper."
}

View File

@ -507,7 +507,7 @@
//SubjectVisitFinalVisitTrigger
"SubjectVisit_CannotSetAsLastVisit": "该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
// ------------------------------------------------------------BusinessFilter--------------------------------------------------------------------
//LimitUserRequestAuthorization
"LimitUser_AuthTokenMissing": "当前请求未从Header/Url取到用户Token,请联系开发者",
"LimitUser_AccountLoggedInElsewhere": "您的账户在其他地方已登陆,您被迫下线。",
@ -522,6 +522,14 @@
"TrialResource_InterceptedProjectStatusRule": "本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改",
"TrialResource_MissingProjectNumber": "该接口参数中,没有传递项目编号,请核对。",
//UnifiedApiResultFilter
"UnifiedAPI_ProgramError": "程序错误,请联系开发人员。"
"UnifiedAPI_ProgramError": "程序错误,请联系开发人员。",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
//FileStoreHelper
"FileStore_TemplateFileNotFound": "数据库没有找到对应的数据模板文件,请联系系统运维人员。",
"FileStore_TemplateFileStoragePathInvalid": "数据模板文件存储路径上未找对应文件,请联系系统运维人员。",
//SendEmailHelper
"SendEmail_SendFail": "邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员",
"SendEmail_NoRecipient": "没有收件人"
}

View File

@ -44,7 +44,8 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<PageOutput<TrialDetailDTO>> GetTrialList(TrialQueryDTO searchParam)
{
var multiModalityIdSelectCount = searchParam.ModalityIds.Count;
var multiModalityIdSelectCount = searchParam.ModalityIds.Count;
var multiCriteriaSelectCount = searchParam.CriterionIds.Count;
var multiReviewTypeSelectCount = searchParam.ReviewTypeIds.Count;

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
namespace IRaCIS.Core.Domain.Share;
@ -16,11 +17,52 @@ public static class StaticData
public static readonly string Zh_CN_Json = "zh-CN.json";
/// <summary>
/// 获取国际化
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static string International(string key, params object?[] args)
{
try
{
return string.Format(GetLanguageDictionary(key), args);
}
catch (Exception)
{
return string.Empty;
}
}
#region 字典表项固定值
public static readonly string Title = "Title";
public static string GetLanguageDictionary(string key)
{
try
{
var type = Thread.CurrentThread.CurrentUICulture.Name;
if (type == "zh-CN")
{
return Zh_CN_Dic[key];
}
else
{
return En_US_Dic[key];
}
}
catch (Exception)
{
return string.Empty;
}
}
#region 字典表项固定值
public static readonly string Title = "Title";
public static readonly string ReadingType = "ReadingType";
public static readonly string Subspeciality = "Subspeciality";

Binary file not shown.