From 962f90de445d7935ad76ea7b74a98f12ce9a7498 Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期二, 01 十二月 2020 23:51:39 +0800 Subject: [PATCH] feat: support vscode i18n-ally plugin --- src/components/Upload/src/data.tsx | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/Upload/src/data.tsx b/src/components/Upload/src/data.tsx index d00c13d..1a9dc3c 100644 --- a/src/components/Upload/src/data.tsx +++ b/src/components/Upload/src/data.tsx @@ -7,14 +7,14 @@ import TableAction from '/@/components/Table/src/components/TableAction'; import { useI18n } from '/@/hooks/web/useI18n'; -const { t } = useI18n('component.upload'); +const { t } = useI18n(); // 鏂囦欢涓婁紶鍒楄〃 export function createTableColumns(): BasicColumn[] { return [ { dataIndex: 'thumbUrl', - title: t('legend'), + title: t('component.upload.legend'), width: 100, customRender: ({ record }) => { const { thumbUrl, type } = (record as FileItem) || {}; @@ -23,7 +23,7 @@ }, { dataIndex: 'name', - title: t('fileName'), + title: t('component.upload.fileName'), align: 'left', customRender: ({ text, record }) => { const { percent, status: uploadStatus } = (record as FileItem) || {}; @@ -47,7 +47,7 @@ }, { dataIndex: 'size', - title: t('fileSize'), + title: t('component.upload.fileSize'), width: 100, customRender: ({ text = 0 }) => { return text && (text / 1024).toFixed(2) + 'KB'; @@ -60,15 +60,15 @@ // }, { dataIndex: 'status', - title: t('fileStatue'), + title: t('component.upload.fileStatue'), width: 100, customRender: ({ text }) => { if (text === UploadResultStatus.SUCCESS) { - return <Tag color="green">{() => t('uploadSuccess')}</Tag>; + return <Tag color="green">{() => t('component.upload.uploadSuccess')}</Tag>; } else if (text === UploadResultStatus.ERROR) { - return <Tag color="red">{() => t('uploadError')}</Tag>; + return <Tag color="red">{() => t('component.upload.uploadError')}</Tag>; } else if (text === UploadResultStatus.UPLOADING) { - return <Tag color="blue">{() => t('uploading')}</Tag>; + return <Tag color="blue">{() => t('component.upload.uploading')}</Tag>; } return text; @@ -79,20 +79,20 @@ export function createActionColumn(handleRemove: Function, handlePreview: Function): BasicColumn { return { width: 120, - title: t('operating'), + title: t('component.upload.operating'), dataIndex: 'action', fixed: false, customRender: ({ record }) => { const actions: ActionItem[] = [ { - label: t('del'), + label: t('component.upload.del'), color: 'error', onClick: handleRemove.bind(null, record), }, ]; if (checkImgType(record)) { actions.unshift({ - label: t('preview'), + label: t('component.upload.preview'), onClick: handlePreview.bind(null, record), }); } @@ -105,7 +105,7 @@ return [ { dataIndex: 'url', - title: t('legend'), + title: t('component.upload.legend'), width: 100, customRender: ({ record }) => { const { url, type } = (record as PreviewFileItem) || {}; @@ -116,7 +116,7 @@ }, { dataIndex: 'name', - title: t('fileName'), + title: t('component.upload.fileName'), align: 'left', }, ]; @@ -133,7 +133,7 @@ }): BasicColumn { return { width: 160, - title: t('operating'), + title: t('component.upload.operating'), dataIndex: 'action', fixed: false, customRender: ({ record }) => { @@ -141,18 +141,18 @@ const actions: ActionItem[] = [ { - label: t('del'), + label: t('component.upload.del'), color: 'error', onClick: handleRemove.bind(null, record), }, { - label: t('download'), + label: t('component.upload.download'), onClick: handleDownload.bind(null, record), }, ]; if (isImgTypeByName(url)) { actions.unshift({ - label: t('preview'), + label: t('component.upload.preview'), onClick: handlePreview.bind(null, record), }); } -- Gitblit v1.8.0