diff --git a/src/components/cards/AuthFooter.js b/src/components/cards/AuthFooter.js index daaa61f..cc6207c 100644 --- a/src/components/cards/AuthFooter.js +++ b/src/components/cards/AuthFooter.js @@ -1,7 +1,7 @@ // material-ui -import { useMediaQuery, Container, Link, Typography, Stack } from '@mui/material'; +import { useMediaQuery, Container, Stack } from '@mui/material'; import bhkLogo from 'assets/images/BHK_logo_rgb_zh-hk.png'; -import {FormattedMessage} from "react-intl"; +import {useIntl} from "react-intl"; import { isGLDLoggedIn, } from "utils/Utils"; @@ -9,57 +9,43 @@ import { const AuthFooter = () => { const matchDownSM = useMediaQuery((theme) => theme.breakpoints.down('sm')); + const intl = useIntl(); + + const bhkAlt = intl.formatMessage({ id: "bhkLogoAlt" }); + const wcagAlt = intl.formatMessage({ id: "wcagAaAlt" }); return ( - + + - - 2024 © - - - - - - - - - - {!isGLDLoggedIn()? - - Level AA conformance,
-                        W3C WAI Web Content Accessibility Guidelines 2.0 - :null - } - - - logo - + ) : null} + + + {bhkAlt} + + ); }; diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 55e4dd6..14c9127 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -25,7 +25,7 @@ import * as yup from 'yup'; import { strengthColorChi, strengthIndicator } from 'utils/password-strength'; // import {apiPath} from "auth/utils"; import axios from "axios"; -import { POST_USERNAME, POST_USER_EMAIL, POST_CAPTCHA, POST_PUBLIC_USER_REGISTER, POST_IDNO } from "utils/ApiPathConst"; +import { POST_USERNAME, POST_USER_EMAIL, POST_CAPTCHA, POST_PUBLIC_USER_REGISTER, POST_IDNO, POST_CAPTCHA_AUDIO } from "utils/ApiPathConst"; // import * as HttpUtils from 'utils/HttpUtils'; import * as ComboData from "utils/ComboData"; @@ -137,6 +137,16 @@ const CustomFormWizard = (props) => { onCaptchaChange(); } }, []); + + const playCaptchaAudio = async () => { + const resp = await axios.post(`${POST_CAPTCHA_AUDIO}`, + { base64Url, lang: intl.locale }, + { responseType: "arraybuffer" } + ); + const blob = new Blob([resp.data], { type: "audio/wav" }); + const url = URL.createObjectURL(blob); + new Audio(url).play(); + }; useEffect(() => { if (selectedIdDocType.type === "HKID"){ @@ -1881,6 +1891,11 @@ const CustomFormWizard = (props) => { {formik.errors.captchaField} )} + + + diff --git a/src/pages/extra-pages/UserMenuPub/index.js b/src/pages/extra-pages/UserMenuPub/index.js index 414c2bb..4c09a93 100644 --- a/src/pages/extra-pages/UserMenuPub/index.js +++ b/src/pages/extra-pages/UserMenuPub/index.js @@ -40,17 +40,49 @@ const UserMenuPub = () => { padding: "8px" }; - const getRow = ({ title, orgEn, orgZh, orgCn, indEn, indZh, indCn }) => { + const getRow = ({ titleId, orgEn, orgZh, orgCn, indEn, indZh, indCn }) => { + const guideTitle = intl.formatMessage({ id: titleId }); + const orgUserType = intl.formatMessage({ id: "forOrgUser" }); + const indUserType = intl.formatMessage({ id: "forIndUser" }); - return <> + const orgHref = locale === "zh-HK" ? orgZh : locale === "en" ? orgEn : orgCn; + const indHref = locale === "zh-HK" ? indZh : locale === "en" ? indEn : indCn; + + return ( - {title} - - + {guideTitle} + + + + + + + + + + - - ; - } + ); + }; + const pnspsurl = "https://"+window.location.hostname; diff --git a/src/translations/en.json b/src/translations/en.json index 0f41b37..2ef12dd 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -8,7 +8,12 @@ "datetimeStrFormat": "DD MMMM YYYY HH:mm:ss", "paymentMethodDatetimeStrFormat": "DD MMMM YYYY h:mm a", "datetimeFormate": "DD MMMM YYYY h:mm a", - + + "bhkLogoAlt": "Brand Hong Kong logo", + "wcagAaAlt": "Level AA conformance, W3C WAI Web Content Accessibility Guidelines 2.0", + "downloadPdfAria": "Download PDF: {guide} ({userType})", + "captchaPlayAudio": "Play audio CAPTCHA", + "PNSPS": "PNSPS", "PNSPS_fullname": "Public Notice Submission and Payment System", "HKSARGOV": "The Government of the Hong Kong Special Administrative Region", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 260d437..591b0bc 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -9,6 +9,11 @@ "paymentMethodDatetimeStrFormat": "YYYY年MM月DD日 ah时mm分", "datetimeFormate": "YYYY年MM月DD日 ah时mm分", + "bhkLogoAlt": "香港品牌标志", + "wcagAaAlt": "符合 WCAG 2.0 AA 级别(W3C WAI 网页内容无障碍指引)", + "downloadPdfAria": "下载 PDF:{guide}({userType})", + "captchaPlayAudio": "播放语音验证码", + "PNSPS": "宪报公共启事提交及缴费系统", "PNSPS_fullname": "公共启事提交及缴费系统", "HKSARGOV": "香港特别行政区政府", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 48fdc35..9157472 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -8,6 +8,11 @@ "datetimeStrFormat": "YYYY年MM月DD日 HH:mm:ss", "paymentMethodDatetimeStrFormat": "YYYY年MM月DD日 ah時mm分", "datetimeFormate": "YYYY年MM月DD日 ah時mm分", + + "bhkLogoAlt": "香港品牌標誌", + "wcagAaAlt": "符合 WCAG 2.0 AA 級別(W3C WAI 網頁內容無障礙指引)", + "downloadPdfAria": "下載 PDF:{guide}({userType})", + "captchaPlayAudio": "播放語音驗證碼", "PNSPS": "憲報公共啟事提交及繳費系統", "PNSPS_fullname": "公共啟事提交及繳費系統", diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index 5008030..ffc148d 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -94,6 +94,9 @@ export const POST_CAPTCHA = apiPath+'/captcha'; export const GET_CONTENT = apiPath+'/getContent'; export const POST_VERIFY_CAPTCHA = apiPath+'/verifyCaptcha'; export const GET_COMBO = apiPath+'/combo-data'; +export const POST_CAPTCHA_AUDIO = apiPath+'/captcha/audio'; + + //register export const POST_PUBLIC_USER_REGISTER = apiPath+'/user/register';