From 38acd82ee1c851c5ee98bf4db938ce913aae29f6 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Wed, 10 Jan 2024 11:53:51 +0800 Subject: [PATCH] update main bar i18n --- src/layout/MainLayout/Header/index.js | 36 ++++++++++++++----- src/pages/Proof/Payment/Pay.js | 5 ++- src/pages/Proof/Payment/Pay_Creditor.js | 5 ++- src/pages/Proof/Reply_Public/index.js | 5 ++- src/pages/Proof/Search_Public/index.js | 5 ++- .../PublicNotice/Details_Public/index.js | 7 ++-- .../Details_Public/tabTableDetail/TabTable.js | 7 ++-- src/pages/PublicNotice/ListPanel/index.js | 5 ++- src/pages/User/ManagePage_OrgPublic/index.js | 5 ++- src/pages/authentication/Login.js | 7 ++-- .../authentication/auth-forms/AuthLogin.js | 3 +- .../auth-forms/AuthLoginCustom.js | 8 +++-- .../auth-forms/BusCustomFormWizard.js | 12 +++---- .../auth-forms/CustomFormWizard.js | 13 +++---- src/translations/en.json | 12 ++++++- src/translations/zh-CN.json | 11 +++++- src/translations/zh-HK.json | 11 +++++- 17 files changed, 119 insertions(+), 38 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 010a498..71c2604 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -141,10 +141,14 @@ function Header(props) {
  • - 我的公共啟事 + + +
  • - 校對記錄 + + +
  • {isPrimaryLoggedIn() ? @@ -152,7 +156,9 @@ function Header(props) { 付款記錄 : - 網上付款記錄 + + + }
  • console.log(event)}> - 設定 + @@ -174,7 +182,11 @@ function Header(props) {
    • - 公司/機構用戶記錄 + + + + +
    : @@ -190,10 +202,18 @@ function Header(props) { const logoutContent = (
  • - 登入 + + + + +
  • - 申請 + + + + +
  • ); diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index c28940a..76f43e6 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -34,6 +34,7 @@ import { } from "react"; import {PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const Index = () => { @@ -83,7 +84,9 @@ const Index = () => {
    - 校對記錄 + + +
    diff --git a/src/pages/Proof/Payment/Pay_Creditor.js b/src/pages/Proof/Payment/Pay_Creditor.js index c2b2b37..2447ed4 100644 --- a/src/pages/Proof/Payment/Pay_Creditor.js +++ b/src/pages/Proof/Payment/Pay_Creditor.js @@ -15,6 +15,7 @@ import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -66,7 +67,9 @@ const Index = () => {
    - 校對記錄 + + +
    diff --git a/src/pages/Proof/Reply_Public/index.js b/src/pages/Proof/Reply_Public/index.js index 43f6e22..f304516 100644 --- a/src/pages/Proof/Reply_Public/index.js +++ b/src/pages/Proof/Reply_Public/index.js @@ -20,6 +20,7 @@ const ApplicationDetails = Loadable(React.lazy(() => import('./ApplicationDetail const ProofForm = Loadable(React.lazy(() => import('./ProofForm'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import MainCard from "../../../components/MainCard"; +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -86,7 +87,9 @@ const Index = () => {
    - 校對記錄 + + +
    diff --git a/src/pages/Proof/Search_Public/index.js b/src/pages/Proof/Search_Public/index.js index 99f3f74..4aed5a9 100644 --- a/src/pages/Proof/Search_Public/index.js +++ b/src/pages/Proof/Search_Public/index.js @@ -15,6 +15,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -83,7 +84,9 @@ const UserSearchPage_Individual = () => {
    - 校對記錄 + + +
    diff --git a/src/pages/PublicNotice/Details_Public/index.js b/src/pages/PublicNotice/Details_Public/index.js index 821e57c..ce0104a 100644 --- a/src/pages/PublicNotice/Details_Public/index.js +++ b/src/pages/PublicNotice/Details_Public/index.js @@ -1,4 +1,4 @@ -import { +import React, { useEffect, useState } from "react"; @@ -31,6 +31,7 @@ import { useNavigate } from "react-router-dom"; import ForwardIcon from '@mui/icons-material/Forward'; import { notifyActionSuccess } from "utils/CommonFunction"; +import {FormattedMessage} from "react-intl"; // ==============================|| Body - DEFAULT ||============================== // @@ -153,7 +154,9 @@ const DashboardDefault = () => {
    - 我的公共啟事 + + +
    diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js index a859255..f511237 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js @@ -13,6 +13,7 @@ import * as React from "react"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; +import {useIntl} from "react-intl"; const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); const ProofTab = Loadable(lazy(() => import('./ProofTab'))); const PaymentTab = Loadable(lazy(() => import('./PaymentTab'))); @@ -25,7 +26,7 @@ const PublicNotice = ({ proofList, paymentList }) => { const [_paymentList, setPaymentList] = React.useState([]); const [onReady, setOnReady] = React.useState(false); const [selectedTab, setSelectedTab] = React.useState("1"); - + const intl = useIntl(); const reloadPage = () => { window.location.reload(false); @@ -55,7 +56,9 @@ const PublicNotice = ({ proofList, paymentList }) => { - + diff --git a/src/pages/PublicNotice/ListPanel/index.js b/src/pages/PublicNotice/ListPanel/index.js index 71a65b6..dfe6192 100644 --- a/src/pages/PublicNotice/ListPanel/index.js +++ b/src/pages/PublicNotice/ListPanel/index.js @@ -25,6 +25,7 @@ const SearchTab = Loadable(lazy(() => import('./SearchPublicNoticeTab'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -106,7 +107,9 @@ const PublicNotice = () => {
    - 我的公共啟事 + + +
    diff --git a/src/pages/User/ManagePage_OrgPublic/index.js b/src/pages/User/ManagePage_OrgPublic/index.js index d2517a0..4a6865e 100644 --- a/src/pages/User/ManagePage_OrgPublic/index.js +++ b/src/pages/User/ManagePage_OrgPublic/index.js @@ -12,6 +12,7 @@ import * as React from "react"; import * as HttpUtils from "utils/HttpUtils"; import * as UrlUtils from "utils/ApiPathConst"; import * as DateUtils from "utils/DateUtils"; +import {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -193,7 +194,9 @@ const ManageOrgUserPage = () => {
    - 公司/機構用戶記錄 + + +
    diff --git a/src/pages/authentication/Login.js b/src/pages/authentication/Login.js index 0ee4876..1f263eb 100644 --- a/src/pages/authentication/Login.js +++ b/src/pages/authentication/Login.js @@ -5,7 +5,8 @@ import { Grid, Stack, Typography } from '@mui/material'; // project import import Loadable from 'components/Loadable'; -import { lazy } from 'react'; +import React, { lazy } from 'react'; +import {FormattedMessage} from "react-intl"; const AuthLogin = Loadable(lazy(() => import('./auth-forms/AuthLoginCustom'))); const AuthWrapper = Loadable(lazy(() => import('./AuthWrapper'))); // import AuthLogin from './auth-forms/AuthLoginCustom'; @@ -17,7 +18,9 @@ const Login = () => ( - 登入 + + + {/* Don't have an account? */} diff --git a/src/pages/authentication/auth-forms/AuthLogin.js b/src/pages/authentication/auth-forms/AuthLogin.js index 00d2128..9e962fe 100644 --- a/src/pages/authentication/auth-forms/AuthLogin.js +++ b/src/pages/authentication/auth-forms/AuthLogin.js @@ -35,6 +35,7 @@ import axios from "axios"; import {useDispatch} from "react-redux"; import {handleLogin} from "auth/index"; import { notifyActionSuccess } from 'utils/CommonFunction'; +import {FormattedMessage} from "react-intl"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLogin = () => { @@ -207,7 +208,7 @@ const AuthLogin = () => { diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 03d5a1b..5f713b8 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -247,7 +247,9 @@ const AuthLoginCustom = () => { - 密碼 + + + { borderColor: "#e7e7e7" } }}> - 登錄 + + + diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 60210ac..27995b5 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -53,12 +53,12 @@ import LoopIcon from '@mui/icons-material/Loop'; import { useTheme } from '@mui/material/styles'; import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; //import { Invaild } from 'utils/IconUtils'; // ============================|| FIREBASE - REGISTER ||============================ // const BusCustomFormWizard = (props) => { - + const intl = useIntl(); const theme = useTheme() const [level, setLevel] = useState(); const [showPassword, setShowPassword] = useState(false); @@ -602,7 +602,7 @@ const BusCustomFormWizard = (props) => { props.setUsername(e.target.value) formik.handleChange(e) }} - placeholder="用戶登入名稱" + placeholder={intl.formatMessage({id: 'userLoginName'})} fullWidth error={Boolean((formik.touched.username && formik.errors.username) || checkUsername)} onBlur={formik.handleBlur} @@ -633,7 +633,7 @@ const BusCustomFormWizard = (props) => { - 密碼 + * @@ -662,7 +662,7 @@ const BusCustomFormWizard = (props) => { } - placeholder="密碼" + placeholder={intl.formatMessage({id: 'userPassword'})} onBlur={formik.handleBlur} inputProps={{ onKeyDown: (e) => { @@ -1421,7 +1421,7 @@ const BusCustomFormWizard = (props) => { - 用戶登入名稱: + {intl.formatMessage({id: 'userLoginName'})}: {formik.values.username} diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 64e70d9..37c1ca1 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -52,11 +52,12 @@ import LoopIcon from '@mui/icons-material/Loop'; import { useTheme } from '@mui/material/styles'; import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage, useIntl} from "react-intl"; // ============================|| FIREBASE - REGISTER ||============================ // const CustomFormWizard = (props) => { - + const intl = useIntl(); const theme = useTheme() const [level, setLevel] = useState(); const [showPassword, setShowPassword] = useState(false); @@ -675,7 +676,7 @@ const CustomFormWizard = (props) => { - 用戶登入名稱 + * {/* { props.setUsername(e.target.value) formik.handleChange(e) }} - placeholder="用戶登入名稱" + placeholder={intl.formatMessage({id: 'userLoginName'})} fullWidth error={Boolean((formik.touched.username && formik.errors.username) || checkUsername)} onBlur={formik.handleBlur} @@ -726,7 +727,7 @@ const CustomFormWizard = (props) => { - 密碼 + * @@ -755,7 +756,7 @@ const CustomFormWizard = (props) => { } - placeholder="密碼" + placeholder={intl.formatMessage({id: 'userPassword'})} onBlur={formik.handleBlur} inputProps={{ onKeyDown: (e) => { @@ -1590,7 +1591,7 @@ const CustomFormWizard = (props) => { - 用戶登入名稱: + : {formik.values.username} diff --git a/src/translations/en.json b/src/translations/en.json index 13de9ad..97ce402 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3,8 +3,18 @@ "zh-HK": "繁體中文", "zh-CN": "简体中文", - "userLoginName": "User login name", "mainPage": "Main Page", + "myPublicNotice": "My Public Notice", + "proofRecord": "Proof Record", + "onlinePaymentHistory": "Online Payment History", + "setting": "Setting", + "companyOrUserRecord": "Company/Institutional User Records", + + "login": "Login", + "register": "Register", + "userLoginName": "Username", + "userPassword": "Password", + "Dashboard": "Dashboard", "event": "Event" diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 187c824..e15b144 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -3,8 +3,17 @@ "zh-HK": "繁體中文", "zh-CN": "简体中文", - "userLoginName": "用戶登入名稱", "mainPage": "主页", + "myPublicNotice": "我的公共启事", + "proofRecord": "校对记录", + "onlinePaymentHistory": "网上付款记录", + "setting": "设置", + "companyOrUserRecord": "公司/机构用户记录", + + "login": "登录", + "register": "申请", + "userLoginName": "用户登入名称", + "userPassword": "密码", "Dashboard": "仪表板", "event": "活动" diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index c0c47b1..2123058 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -3,8 +3,17 @@ "zh-HK": "繁體中文", "zh-CN": "简体中文", - "userLoginName": "用戶登入名稱", "mainPage": "主頁", + "myPublicNotice": "我的公共啟事", + "proofRecord": "校對記錄", + "onlinePaymentHistory": "網上付款記錄", + "setting": "設定", + "companyOrUserRecord": "公司/機構用戶記錄", + + "login": "登入", + "register": "申請", + "userLoginName": "用戶登入名稱", + "userPassword": "密碼", "Dashboard": "儀表板", "event": "活動"