Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): 国际化版本部分项目中文名称对应错误 #878

Merged
merged 5 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/wet-hounds-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@scow/portal-web": patch
"@scow/mis-web": patch
---

修改了国际化的中文显示差异,中文符号的全角,补充了部分漏项
2 changes: 1 addition & 1 deletion apps/mis-web/src/components/JobBillingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const JobBillingTable: React.FC<Props> = ({ data, loading }) => {
children: getI18nConfigCurrentText(publicConfig.CLUSTERS[r.cluster]?.name, languageId) ?? r.cluster,
props: { rowSpan: r.clusterItemIndex === 0 && clusterTotalQosCounts ? clusterTotalQosCounts[r.cluster] : 0 },
}) },
{ dataIndex: "partition", title: t(pCommon("partition")), key: "index", render: (_, r) => ({
{ dataIndex: "partition", title: t(p("partitionFullName")), key: "index", render: (_, r) => ({
children: r.partition,
props: { rowSpan: r.partitionItemIndex === 0 ? r.qosCount : 0 },
}) },
Expand Down
13 changes: 11 additions & 2 deletions apps/mis-web/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ export default {
operation: "Operation",
tenant: "Tenant",
tenantName: "Tenant Name",
tenantFullName:"Tenant Name",
tenantRole: "User Role",
user: "User",
userId: "User ID",
userName: "Username",
userFullName:"User Name",
import: "Import",
fresh: "Refresh",
account: "Account",
accountInfo: "Account Information",
accountName: "Account Name",
owner: "Owner",
selectTenant: "Please Select a Tenant",
Expand All @@ -50,6 +53,7 @@ export default {
modify: "Modify",
cancel: "Cancel",
cluster: "Cluster",
clusterName:"Cluster Name",
workId: "Job ID",
minute: "Minutes",
name: "Name",
Expand Down Expand Up @@ -77,6 +81,7 @@ export default {
jobBillingTable: "Job Pricing Table",
operationLog: "Operation Log",
unfinishedJob: "Unfinished Jobs",
finishedJobs: "Finished Jobs",
userList: "User List",
platformInfo: "Platform Information",
platformAdmin: "Platform Administrator",
Expand Down Expand Up @@ -530,6 +535,7 @@ export default {
adminJobTable: {
batch: "Batch Search",
precise: "Precision Search",
jobEndTime: "Job End Time",
adjust: "Adjust all jobs in search results",
tenantPrice: "Tenant Billing",
platformPrice: "Platform Billing",
Expand All @@ -542,6 +548,7 @@ export default {
tenantAdmin: "Tenant Administrator",
tenantFinance: "Financial Staff",
idOrName: "User ID or Name",
name:"Name",
tenantRole: "Tenant Role",
affiliatedAccountName: "Available Accounts",
notExist: "User does not exist",
Expand All @@ -553,10 +560,11 @@ export default {
jobPriceChangeModal: {
tenantPrice: "Tenant Billing",
platformPrice: "Platform Billing",
changeJob: "Change Job",
changeJob: "Change Job ",
jobNumber: "Job Number",
newJob: "New Job",
newJob: "New Job ",
reason: "Reason for Modification",
modifyButton: "Modify ",
},
tenantSelector: {
fresh: "Refresh Tenant List",
Expand Down Expand Up @@ -658,6 +666,7 @@ export default {
newPassword: "New Password",
confirmPassword: "Confirm Password",
selectCluster: "Select Cluster",
partitionFullName:"Full Name of Partition",
nodes: "Number of Partition Nodes",
cores: "Number of Cores per Node",
gpus: "Number of GPUs per Node",
Expand Down
51 changes: 30 additions & 21 deletions apps/mis-web/src/i18n/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ export default {
operation:"操作",
tenant:"租户",
tenantName:"租户名",
tenantRole: "用户角色",
tenantFullName:"租户名称",
tenantRole: "租户角色",
user:"用户",
userId:"用户ID",
userName:"用户名",
userFullName:"用户姓名",
import:"导入",
fresh:"刷新",
account:"账户",
accountInfo: "账户信息",
accountName:"账户名",
owner:"拥有者",
selectTenant:"请选择租户",
Expand All @@ -50,6 +53,7 @@ export default {
modify:"修改",
cancel:"取消",
cluster:"集群",
clusterName:"集群名",
workId:"作业ID",
minute:"分钟",
name:"姓名",
Expand Down Expand Up @@ -77,10 +81,11 @@ export default {
jobBillingTable: "作业价格表",
operationLog: "操作日志",
unfinishedJob: "未结束的作业",
finishedJobs: "已结束的作业",
userList: "用户列表",
platformInfo: "平台信息",
platformAdmin: "平台管理员",
platformFinancialStaff: "平台财务员工",
platformFinancialStaff: "平台财务人员",
tenantCount: "租户数量",
accountList: "账户列表",
tenantList: "租户列表",
Expand Down Expand Up @@ -233,7 +238,7 @@ export default {
},
admin:{
allTenantsTable:{
tenantName:"租户名",
tenantName:"租户名称",
accountCount:"账户数量",
},
allUserTable:{
Expand Down Expand Up @@ -288,9 +293,9 @@ export default {
total:"总数",
sum:"合计",
paymentDate:"交费日期",
paymentAmount:"交费日期",
paymentAmount:"交费金额",
ipAddress:"IP地址",
operatorId:"操作者Id",
operatorId:"操作者ID",
},
},
dashboard:{
Expand Down Expand Up @@ -406,14 +411,14 @@ export default {
timeExplanation: "此处设置的时间为作业执行的总时间",
},
editableJobBillingTable:{
alreadyUsed:"此Id已经被使用",
alreadyUsed:"此ID已经被使用",
addSuccess:"添加成功!",
edit:"编辑作业价格项",
defaultPrice:"默认价格项",
path:"计费路径",
id:"计费项Id",
id:"计费项ID",
strategy:"计费策略",
price:"价格(元)",
price:"价格(元)",
name:"分区全名",
nodes:"分区节点数",
cores:"单节点核心数",
Expand All @@ -427,19 +432,19 @@ export default {
timeSubmit:"提交时间",
timeStart:"开始时间",
timeEnd:"结束时间",
gpus:"使用GPU数(个)",
cpusReq:"申请CPU数(个)",
cpusAlloc:"分配CPU数(个)",
memReq:"申请的内存(MB)",
memAlloc:"分配的内存(MB)",
nodesReq:"申请节点数(个)",
nodesAlloc:"分配节点数(个)",
timeLimit:"作业时间限制(分钟)",
timeUsed:"作业执行时间(秒)",
timeWait:"作业等待时间(秒)",
gpus:"使用GPU数(个)",
cpusReq:"申请CPU数(个)",
cpusAlloc:"分配CPU数(个)",
memReq:"申请的内存(MB)",
memAlloc:"分配的内存(MB)",
nodesReq:"申请节点数(个)",
nodesAlloc:"分配节点数(个)",
timeLimit:"作业时间限制(分钟)",
timeUsed:"作业执行时间(秒)",
timeWait:"作业等待时间(秒)",
recordTime:"记录时间",
workFee:"作业计费(元)",
tenantFee:"租户计费(元)",
workFee:"作业计费(元)",
tenantFee:"租户计费(元)",
platformFee:"平台计费",
detail:"作业详细信息",
},
Expand Down Expand Up @@ -530,6 +535,7 @@ export default {
adminJobTable:{
batch:"批量搜索",
precise:"精确搜索",
jobEndTime: "作业结束时间",
adjust:"调整搜索结果所有作业",
tenantPrice:"租户计费",
platformPrice:"平台计费",
Expand All @@ -542,6 +548,7 @@ export default {
tenantAdmin:"租户管理员",
tenantFinance:"财务人员",
idOrName:"用户ID或者姓名",
name:"姓名",
tenantRole:"租户角色",
affiliatedAccountName:"可用账户",
notExist:"用户不存在",
Expand All @@ -557,6 +564,7 @@ export default {
jobNumber:"作业数量",
newJob:"新作业",
reason:"修改原因",
modifyButton: "修改",
},
tenantSelector:{
fresh:"刷新租户列表",
Expand Down Expand Up @@ -658,6 +666,7 @@ export default {
newPassword:"新密码",
confirmPassword:"确认密码",
selectCluster:"请选择集群",
partitionFullName:"分区全名",
nodes:"分区节点数",
cores:"单节点核心数",
gpus:"单节点GPU数",
Expand Down Expand Up @@ -784,7 +793,7 @@ export default {
userIdAndNameNotMatch: "用户ID和名字不匹配。",
createSuccess: "创建成功!",
ownerUserId: "拥有者用户ID",
ownerName: "拥有着姓名",
ownerName: "拥有者姓名",
remark: "备注",
createAccount: "创建账户",
},
Expand Down
4 changes: 2 additions & 2 deletions apps/mis-web/src/pageComponents/admin/CreateTenantForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const CreateTenantForm: React.FC = () => {
plain
>{t(p("prompt"))}</Divider>
<Form.Item
label={t(pCommon("tenantName"))}
label={t(pCommon("tenantFullName"))}
name="tenantName"
rules={[
{ required: true },
Expand All @@ -65,7 +65,7 @@ export const CreateTenantForm: React.FC = () => {
>
<Input placeholder={userIdRule?.message} />
</Form.Item>
<Form.Item label={t(pCommon("userName"))} name="userName" rules={[{ required: true }]}>
<Form.Item label={t(pCommon("userFullName"))} name="userName" rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/admin/TenantChargeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const TenantChargeForm: React.FC = () => {
>
<Form.Item
name="tenantName"
label={t(pCommon("tenantName"))}
label={t(pCommon("tenant"))}
rules={[{ required: true }]}
>
<TenantSelector
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/job/HistoryJobDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const HistoryJobDrawer: React.FC<Props> = (props) => {
[t(pCommon("partition")), "partition"],
[t(p("list")), "nodelist"],
[t(pCommon("workName")), "jobName"],
[t(pCommon("cluster")), "cluster", getClusterName],
[t(pCommon("clusterName")), "cluster", getClusterName],
[t(p("timeSubmit")), "timeSubmit", formatDateTime],
[t(p("timeStart")), "timeStart", formatDateTime],
[t(p("timeEnd")), "timeEnd", formatDateTime],
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/job/HistoryJobTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export const JobInfoTable: React.FC<JobInfoTableProps> = ({
}
<Table.Column<JobInfo>
dataIndex="cluster"
title={t(pCommon("cluster"))}
title={t(pCommon("clusterName"))}
render={(cluster) => getClusterName(cluster, languageId)}
/>
<Table.Column<JobInfo> dataIndex="partition" title={t(pCommon("partition"))} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const ManageJobBillingTable: React.FC<Props> = ({ data, loading, tenant,
}}
/>
<Table.Column
title={t(pCommon("price"))}
title={t(p("price"))}
dataIndex={["priceItem", "price"]}
render={(value) => value ? moneyToString(value) : undefined}
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/job/RunningJobTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const RunningJobQueryTable: React.FC<Props> = ({
<Form.Item label={t(pCommon("cluster"))} name="cluster">
<SingleClusterSelector />
</Form.Item>
<Form.Item label={t(pCommon("clusterWorkId"))} name="jobId">
<Form.Item label={t(pCommon("workId"))} name="jobId">
<InputNumber style={{ minWidth: "160px" }} min={1} />
</Form.Item>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const AccountWhitelistTable: React.FC<Props> = ({
>
<Table.Column<WhitelistedAccount>
dataIndex="accountName"
title={t(pCommon("account"))}
title={t(pCommon("accountName"))}
sorter={(a, b) => a.accountName.localeCompare(b.accountName)}
sortDirections={["ascend", "descend"]}
sortOrder={currentSortInfo.field === "accountName" ? currentSortInfo.order : null}
Expand Down
8 changes: 4 additions & 4 deletions apps/mis-web/src/pageComponents/tenant/AdminJobTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const AdminJobTable: React.FC<Props> = () => {
<Form.Item label={t(pCommon("account"))} name="accountName">
<Input />
</Form.Item>
<Form.Item label={t(pCommon("timeEnd"))} name="jobEndTime">
<Form.Item label={t(p("jobEndTime"))} name="jobEndTime">
<DatePicker.RangePicker showTime allowClear={false} presets={getDefaultPresets(languageId)} />
</Form.Item>
</>
Expand Down Expand Up @@ -261,9 +261,9 @@ const JobInfoTable: React.FC<JobInfoTableProps> = ({
} : false}
scroll={{ x: true }}
>
<Table.Column<JobInfo> dataIndex="idJob" title="集群作业ID" />
<Table.Column<JobInfo> dataIndex="account" title="账户" />
<Table.Column<JobInfo> dataIndex="user" title="用户" />
<Table.Column<JobInfo> dataIndex="idJob" title={t(pCommon("clusterWorkId"))} />
<Table.Column<JobInfo> dataIndex="account" title={t(pCommon("account"))} />
<Table.Column<JobInfo> dataIndex="user" title={t(pCommon("user"))} />
<Table.Column<JobInfo>
dataIndex="cluster"
title={t(pCommon("cluster"))}
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/tenant/AdminUserTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const AdminUserTable: React.FC<Props> = ({
/>
<Table.Column<FullUserInfo>
dataIndex="name"
title={t(pCommon("userName"))}
title={t(p("name"))}
sorter={(a, b) => a.name.localeCompare(b.name)}
sortDirections={["ascend", "descend"]}
sortOrder={currentSortInfo.field === "name" ? currentSortInfo.order : null}
Expand Down
12 changes: 7 additions & 5 deletions apps/mis-web/src/pageComponents/tenant/JobPriceChangeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ interface FormProps {
const p = prefix("pageComp.tenant.jobPriceChangeModal.");
const pCommon = prefix("common.");

const text = {
"account": "tenantPrice",
"tenant": "platformPrice",
};


export const JobPriceChangeModal: React.FC<Props> = ({ open, onClose, jobCount, filter, target, reload }) => {

Expand All @@ -47,11 +44,16 @@ export const JobPriceChangeModal: React.FC<Props> = ({ open, onClose, jobCount,

const { message } = App.useApp();

const text = {
"account": t(p("tenantPrice")),
"tenant": t(p("platformPrice")),
};

return (
<Modal
open={open}
title={`${t(p("changeJob"))}${text[target]}`}
okText={`${t(pCommon("modify"))}${text[target]}`}
okText={`${t(p("modifyButton"))}${text[target]}`}
cancelText={t(pCommon("cancel"))}
onCancel={onClose}
confirmLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/users/AddUserButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const NewUserModal: React.FC<ModalProps> = ({
>
<Input placeholder={userIdRule?.message} />
</Form.Item>
<Form.Item name="name" required label={t(pCommon("userName"))}>
<Form.Item name="name" required label={t(pCommon("userFullName"))}>
<Input />
</Form.Item>
</Form>
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/users/CreateUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const CreateUserForm: React.FC = () => {
>
<Input placeholder={userIdRule?.message} />
</Form.Item>
<Form.Item label={t(pCommon("userName"))} name="name" rules={[{ required: true }]}>
<Form.Item label={t(pCommon("userFullName"))} name="name" rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item
Expand Down
2 changes: 1 addition & 1 deletion apps/mis-web/src/pageComponents/users/CreateUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const CreateUserModal: React.FC<Props> = ({
>
<Input disabled placeholder={userIdRule?.message} />
</Form.Item>
<Form.Item label={t(pCommon("userName"))} name="name" rules={[{ required: true }]}>
<Form.Item label={t(pCommon("userFullName"))} name="name" rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item
Expand Down
Loading
Loading