diff --git a/src/components/FileList.js b/src/components/FileList.js index 84d94c0..8b2901b 100644 --- a/src/components/FileList.js +++ b/src/components/FileList.js @@ -104,7 +104,7 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable { id: 'filesize', field: 'filesize', - headerName: intl.formatMessage({id: 'fileName'}), + headerName: intl.formatMessage({id: 'fileSize'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index e44eca3..7ca837d 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -111,7 +111,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { - 到 + diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 63b486a..de693e7 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -23,6 +23,7 @@ const ApplicationDetailCard = ({ formData, }) => { const params = useParams(); const intl = useIntl(); + const { locale } = intl; const [data, setData] = React.useState({}); //const [proofId, setProofId] = React.useState(); @@ -132,7 +133,7 @@ const ApplicationDetailCard = ({ formData, }) => { - : + : @@ -163,7 +164,9 @@ const ApplicationDetailCard = ({ formData, }) => { - 刊出日期: + + : + @@ -202,7 +205,9 @@ const ApplicationDetailCard = ({ formData, }) => { - 請下載下列印刷稿檔案,並仔細校對: + + : + { - 繳費及返稿最後限期: + + + + + : + -  {DateUtils.datetimeStr_Cht(data.returnBeforeDate)} 前 +   + {locale === 'en' ? + `${intl.formatMessage({id: 'before'})} ${DateUtils.datetimeStr(data.returnBeforeDate)} ` + : + `${DateUtils.datetimeStr_Cht(data.returnBeforeDate)} ${intl.formatMessage({id: 'before'})}` + } + @@ -243,9 +259,9 @@ const ApplicationDetailCard = ({ formData, }) => { { formik.values.groupType === "Private Bill" ? - ( {data.noOfPages} 頁 x $6,552 ) + ( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 ) : - ( {data.length} cm x {data.colCount == 2 ? "$364 二格位" : "$182 一格位"} ) + ( {data.length} cm x {data.colCount === 2 ? "$364 二格位" : "$182 一格位"} ) } diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index c998c29..4041777 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -32,6 +32,7 @@ const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); const FormPanel = ({ formData }) => { const intl = useIntl(); + const { locale } = intl; const [data, setData] = React.useState({}); const [attachments, setAttachments] = React.useState([]); @@ -53,7 +54,7 @@ const FormPanel = ({ formData }) => { enableReinitialize: true, initialValues: data, validationSchema: yup.object().shape({ - vaild: yup.string().max(255, "請輸入你的登入密碼").required('請輸入你的登入密碼'), + vaild: yup.string().max(255, intl.formatMessage({id: 'requireLoginPassword'})).required(intl.formatMessage({id: 'requireLoginPassword'})), }), onSubmit: values => { if (!actionValue) { @@ -91,12 +92,12 @@ const FormPanel = ({ formData }) => { } }, onFail: function (response) { - setWarningText("行動失敗: 請檢查內容並再次提交回覆"); + setWarningText(intl.formatMessage({id: 'actionFail'})); setIsWarningPopUp(true); console.log(response); }, onError: function (error) { - setWarningText("行動失敗: 請檢查內容並再次提交回覆"); + setWarningText(intl.formatMessage({id: 'actionFail'})); setIsWarningPopUp(true); console.log(error); } @@ -152,10 +153,27 @@ const FormPanel = ({ formData }) => { formik.values.replyDate ? - 校對回覆日期: {DateUtils.datetimeStr_Cht(formik.values.replyDate)} + + : + { + locale === 'en' ? + DateUtils.dateStr(formik.values.replyDate) + : + DateUtils.datetimeStr_Cht(formik.values.replyDate) + } + - 校對回覆: {formik.values.action ? (可以付印(稿件正確)) : (未能付印(需要修改))} + + : {formik.values.action ? + ( + + ) + : + ( + + )} + { formik.values.action ? @@ -195,11 +213,11 @@ const FormPanel = ({ formData }) => { name="action" defaultValue={true} onChange={(event) => { - setActionValue(event.target.value == "true" ? true : false); + setActionValue(event.target.value === "true" ? true : false); }} > - } label="可以付印(稿件正確)" /> - } label="未能付印(需要修改)" /> + } label={intl.formatMessage({id: 'proofErrorFree'})} /> + } label={intl.formatMessage({id: 'proofWithError'})} /> @@ -210,7 +228,9 @@ const FormPanel = ({ formData }) => { : <> - 請上載稿件修改的檔案: + + : + @@ -233,7 +253,7 @@ const FormPanel = ({ formData }) => { variant="contained" disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)} > - 上載 + @@ -249,7 +269,9 @@ const FormPanel = ({ formData }) => { - 簽署: + + : + { variant="outlined" error={Boolean(formik.errors["vaild"])} helperText={formik.errors["vaild"] ? formik.errors["vaild"] : ' '} - placeholder="請輸入你的登入密碼" + placeholder={intl.formatMessage({id: 'requireLoginPassword'})} sx={ { "& .MuiInputBase-input.Mui-disabled": { @@ -282,7 +304,7 @@ const FormPanel = ({ formData }) => { color="success" type="submit" > - 提交回覆 + diff --git a/src/pages/Proof/Reply_Public/UploadFileTable.js b/src/pages/Proof/Reply_Public/UploadFileTable.js index cd5706a..1a44ad5 100644 --- a/src/pages/Proof/Reply_Public/UploadFileTable.js +++ b/src/pages/Proof/Reply_Public/UploadFileTable.js @@ -77,7 +77,7 @@ export default function UploadFileTable({recordList, setRecordList,}) { { id: 'name', field: 'name', - headerName: '檔案名稱', + headerName: intl.formatMessage({id: 'fileName'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, }, diff --git a/src/pages/Proof/Search_Public/DataGrid.js b/src/pages/Proof/Search_Public/DataGrid.js index 47aaf71..3bb6ceb 100644 --- a/src/pages/Proof/Search_Public/DataGrid.js +++ b/src/pages/Proof/Search_Public/DataGrid.js @@ -21,6 +21,7 @@ export default function SearchPublicNoticeTable({ recordList }) { const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); const intl = useIntl(); + const { locale } = intl; const _sx = { padding: "4 2 4 2", @@ -78,7 +79,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appId', field: 'appId', - headerName: isORGLoggedIn()?"憲報期數 / Care Of/ 我的備註":"憲報期數 / 我的備註", + headerName: isORGLoggedIn()?intl.formatMessage({id: 'gazetteCount3'}):intl.formatMessage({id: 'gazetteCount2'}), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { @@ -106,13 +107,13 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'returnBeforeDate', field: 'returnBeforeDate', - headerName: '此日期前回覆', + headerName: intl.formatMessage({id: 'replyBefore'}), width: isMdOrLg ? 'auto' : 250, flex: isMdOrLg ? 1.5 : undefined, valueGetter: (params) => { let returnBeforeDate = DateUtils.convertToDate(params?.value); returnBeforeDate = returnBeforeDate.setHours(14, 0, 0, 0); - return DateUtils.datetimeStr_Cht(returnBeforeDate); + return locale === 'en' ? DateUtils.datetimeStr(returnBeforeDate) : DateUtils.datetimeStr_Cht(returnBeforeDate); } }, { @@ -131,7 +132,7 @@ export default function SearchPublicNoticeTable({ recordList }) { width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { - return ProofStatus.getStatus_Cht(params); + return locale === 'en' ? ProofStatus.getStatus_Eng(params) : ProofStatus.getStatus_Cht(params); }, }, { diff --git a/src/pages/Proof/Search_Public/SearchForm.js b/src/pages/Proof/Search_Public/SearchForm.js index a939936..b4b69a9 100644 --- a/src/pages/Proof/Search_Public/SearchForm.js +++ b/src/pages/Proof/Search_Public/SearchForm.js @@ -203,7 +203,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData - 到 + @@ -249,8 +249,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData filterOptions={(options) => options} options={ComboData.proofStatus} value={status} - getOptionLabel={(option) => option.labelCht} - inputValue={status?.labelCht ? status?.labelCht : ""} + getOptionLabel={(option) => option.type? intl.formatMessage({ id: option.i18nLabel }) : ""} + inputValue={status? intl.formatMessage({ id: status.i18nLabel }) : ""} onChange={(event, newValue) => { if (newValue !== null) { setStatus(newValue); diff --git a/src/translations/en.json b/src/translations/en.json index 778e58b..3edf6a8 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -197,7 +197,10 @@ "applyPublicNotice": "Apply for public notice", "attention": "attention", + "to": "To", "all": "All", + "replied": "Replied", + "pendingReply": "PendingReply", "processing": "Processing", "pendingPayment": "Pending payment", "pendingPublish": "To be Published", @@ -244,7 +247,9 @@ "publicNoticeDetailTitle": "Public Notice Application Information", "applyPerson": "Applicant", "applyStatus": "Application Status", - "gazetteCount": "Gazette issues date", + "gazetteCount": "Gazette issues number", + "gazetteCount2" :"Gazette issues number / Remarks", + "gazetteCount3" :"Gazette issues number / Care Of/ Remarks", "publishDate": "Publish date", "draftFile": "Manuscript file", "download": "Download", @@ -257,6 +262,24 @@ "payFeeFor": "Pay for", "payFor": "Pay", "payFee": "Payment Amount", + "replyBefore": "Reply before", + "applicationPublishDate": "Publish date", + "pleaseCheckReminder": "Please download the following printed manuscript file and proofread it carefully", + "payAnd": "Pay and ", + "commentDeadline": "Deadline for submission of manuscripts", + "before": "Before", + "page": "Page", + "proofReplyDate": "Proof Reply Date", + "proofReply": "Proof Reply", + "proofErrorFree": "Can be printed (the manuscript is correct)", + "proofWithError": "Failed to print (requires modification)", + "proofExpired": "Response timed out, please apply again.", + "sign": "Sign", + "requireLoginPassword": "Please enter your login password", + "submitReply": "Submit", + "requiredUploadFix": "Please upload the modified file of the manuscript", + "upload": "Upload", + "actionFail": "Action failed: Please check the content and submit the reply again", "Dashboard": "Dashboard", "event": "Event" diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index dc8870f..fe538c9 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -197,7 +197,10 @@ "applyPublicNotice": "申请公共启事", "attention": "注意", + "to": "到", "all": "全部", + "replied": "已回覆", + "pendingReply": "未回覆", "processing": "处理中", "pendingPayment": "待付款", "pendingPublish": "待发布", @@ -245,6 +248,8 @@ "applyPerson": "申请人", "applyStatus": "申请状态", "gazetteCount": "宪报期数", + "gazetteCount2" :"宪报期数 / 我的备注", + "gazetteCount3" :"宪报期数 / Care Of/ 我的备注", "publishDate": "发布日期", "draftFile": "稿件档案", "download": "下载", @@ -257,6 +262,24 @@ "payFeeFor": "应缴费用", "payFor": "支付", "payFee": "支付金額", + "replyBefore": "此日期前回覆", + "applicationPublishDate": "刊出日期", + "pleaseCheckReminder": "请下载下列印刷稿档案,并仔细校对", + "payAnd": "缴费及", + "commentDeadline": "返稿最后限期", + "before": "前", + "page": "页", + "proofReplyDate": "校对回覆日期", + "proofReply": "校对回覆", + "proofErrorFree": "可以付印(稿件正确)", + "proofWithError": "未能付印(需要修改)", + "proofExpired": "回覆逾时,请重新申请。", + "sign": "签署", + "requireLoginPassword": "请输入你的登入密码", + "submitReply": "提交回覆", + "requiredUploadFix": "请上载稿件修改的档案", + "upload": "上载", + "actionFail": "行动失败: 请检查内容并再次提交回覆", "Dashboard": "仪表板", "event": "活动" diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 75449ab..9d43c05 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -197,7 +197,10 @@ "applyPublicNotice": "申請公共啟事", "attention": "注意", + "to": "到", "all": "全部", + "replied": "已回覆", + "pendingReply": "未回覆", "processing": "處理中", "pendingPayment": "待付款", "pendingPublish": "待發佈", @@ -245,6 +248,8 @@ "applyPerson": "申請人", "applyStatus": "申請狀態", "gazetteCount": "憲報期數", + "gazetteCount2" :"憲報期數 / 我的備註", + "gazetteCount3" :"憲報期數 / Care Of/ 我的備註", "publishDate": "發佈日期", "draftFile": "稿件檔案", "download": "下載", @@ -257,6 +262,24 @@ "payFeeFor": "應繳費用", "payFor": "支付", "payFee": "支付金額", + "replyBefore": "此日期前回覆", + "applicationPublishDate": "刊出日期", + "pleaseCheckReminder": "請下載下列印刷稿檔案,並仔細校對", + "payAnd": "繳費及", + "commentDeadline": "返稿最後限期", + "before": "前", + "page": "頁", + "proofReplyDate": "校對回覆日期", + "proofReply": "校對回覆", + "proofErrorFree": "可以付印(稿件正確)", + "proofWithError": "未能付印(需要修改)", + "proofExpired": "回覆逾時,請重新申請。", + "sign": "簽署", + "requireLoginPassword": "請輸入你的登入密碼", + "submitReply": "提交回覆", + "requiredUploadFix": "請上載稿件修改的檔案", + "upload": "上載", + "actionFail": "行動失敗: 請檢查內容並再次提交回覆", "Dashboard": "儀表板", "event": "活動" diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index de70425..147ce93 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -92,9 +92,9 @@ export const proofPrice = [ ]; export const proofStatus = [ - { key: 0, labelCht: '全部', label: 'All', type: 'all' }, - { key: 1, labelCht: '已回覆', label:'Replied', type: 'T' }, // submitted and reviewed - { key: 2, labelCht: '未回覆', label:'Pending Reply', type: 'F' }, + { key: 0, i18nLabel: 'all', labelCht: '全部', label: 'All', type: 'all' }, + { key: 1, i18nLabel: 'replied', labelCht: '已回覆', label:'Replied', type: 'T' }, // submitted and reviewed + { key: 2, i18nLabel: 'pendingReply', labelCht: '未回覆', label:'Pending Reply', type: 'F' }, ]; export const paymentStatus = [