From b6724ab8c1ce8272090092f47b934e8dcb264501 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 19 九月 2024 10:49:51 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/components/ImportModal.jsx | 21 ++++++++++----------- zy-acs-flow/src/i18n/core/chineseMessages.js | 4 ++-- zy-acs-flow/src/i18n/en.js | 8 ++++++++ zy-acs-flow/src/i18n/zh.js | 8 ++++++++ zy-acs-flow/src/page/components/ImportButton.jsx | 2 +- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/zy-acs-flow/src/i18n/core/chineseMessages.js b/zy-acs-flow/src/i18n/core/chineseMessages.js index 17c8a87..cb0638d 100644 --- a/zy-acs-flow/src/i18n/core/chineseMessages.js +++ b/zy-acs-flow/src/i18n/core/chineseMessages.js @@ -60,8 +60,8 @@ input: { file: { upload_several: - 'Drop some files to upload, or click to select one.', - upload_single: 'Drop a file to upload, or click to select it.', + '鎷栨斁涓�浜涜涓婁紶鐨勬枃浠讹紝鎴栧崟鍑讳互閫夋嫨涓�涓�', + upload_single: '鎷栨斁瑕佷笂浼犵殑鏂囦欢锛屾垨鍗曞嚮浠ラ�夋嫨瀹�', }, image: { upload_several: diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js index c7b3e33..c50e9b2 100644 --- a/zy-acs-flow/src/i18n/en.js +++ b/zy-acs-flow/src/i18n/en.js @@ -48,6 +48,14 @@ collapse: 'Collapse', collapseAll: 'Collapse All', scope: 'Assign', + import: { + title: 'Import', + stop: 'Stop import', + msg: 'Here is a sample CSV file you can use as a template', + tips: 'The import is running, please do not close this tab.', + err: 'Failed to import this file, please make sure your provided a valid CSV file.', + download: 'Download Import Template', + } }, }, filters: { diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js index f6a2717..6b2eb44 100644 --- a/zy-acs-flow/src/i18n/zh.js +++ b/zy-acs-flow/src/i18n/zh.js @@ -48,6 +48,14 @@ collapse: '鎶樺彔', collapseAll: '鍏ㄩ儴鎶樺彔', scope: '鏉冮檺', + import: { + title: '瀵煎叆', + stop: '鍋滄瀵煎叆', + msg: '杩欐槸涓�涓彲浠ョ敤浣滄ā鏉跨殑绀轰緥 CSV 鏂囦欢', + tips: '姝e湪瀵煎叆涓紝璇蜂笉瑕佸叧闂绐楀彛', + err: '鏃犳硶瀵煎叆姝ゆ枃浠讹紝璇风‘淇濇偍鎻愪緵浜嗘湁鏁堢殑 CSV 鏂囦欢', + download: '涓嬭浇瀵煎叆妯℃澘', + } }, }, filters: { diff --git a/zy-acs-flow/src/page/components/ImportButton.jsx b/zy-acs-flow/src/page/components/ImportButton.jsx index 5a2c122..147ec9e 100644 --- a/zy-acs-flow/src/page/components/ImportButton.jsx +++ b/zy-acs-flow/src/page/components/ImportButton.jsx @@ -18,7 +18,7 @@ <> <Button startIcon={<UploadIcon />} - label="Import" + label="common.action.import.title" onClick={handleOpenModal} /> diff --git a/zy-acs-flow/src/page/components/ImportModal.jsx b/zy-acs-flow/src/page/components/ImportModal.jsx index 97f7285..2344d49 100644 --- a/zy-acs-flow/src/page/components/ImportModal.jsx +++ b/zy-acs-flow/src/page/components/ImportModal.jsx @@ -13,6 +13,7 @@ Form, Toolbar, useRefresh, + useTranslate } from 'react-admin'; import { Link } from 'react-router-dom'; import DialogCloseButton from './DialogCloseButton'; @@ -20,6 +21,7 @@ const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10 }) => { const refresh = useRefresh(); + const translate = useTranslate(); const { processBatch } = useCodeImport(); const { importer, parseCsv, reset } = usePapaParse({ @@ -60,7 +62,7 @@ return ( <Dialog open={open} maxWidth="md" fullWidth> <DialogCloseButton onClose={handleClose} /> - <DialogTitle>Import</DialogTitle> + <DialogTitle>{translate('common.action.import.title')}</DialogTitle> <DialogContent> <Form> <Stack spacing={2}> @@ -88,8 +90,7 @@ }, }} > - The import is running, please do not close - this tab. + {translate('common.action.import.tips')} </Alert> <Typography variant="body2"> Imported{' '} @@ -115,7 +116,7 @@ onClick={handleReset} color="error" > - Stop import + {translate('common.action.import.stop')} </MuiLink> </> )} @@ -125,8 +126,7 @@ {importer.state === 'error' && ( <Alert severity="error"> - Failed to import this file, please make sure - your provided a valid CSV file. + {translate('common.action.import.err')} </Alert> )} @@ -145,15 +145,14 @@ action={ <Button component={Link} - label="Download CSV sample" + label="common.action.import.download" color="info" to={importTemp} download={'crm_contacts_sample.csv'} /> } > - Here is a sample CSV file you can use as a - template + {translate('common.action.import.msg')} </Alert> <FileInput @@ -183,7 +182,7 @@ {importer.state === 'idle' ? ( <> <Button - label="Import" + label="common.action.import.title" variant="contained" onClick={startImport} disabled={!file} @@ -191,7 +190,7 @@ </> ) : ( <Button - label="Close" + label="ra.action.close" onClick={handleClose} disabled={importer.state === 'running'} /> -- Gitblit v1.9.1