Browse Source

update setting page i18n

master
jason.lam 1 year ago
parent
commit
016b915a5a
8 changed files with 90 additions and 68 deletions
  1. +2
    -2
      src/layout/MainLayout/Header/index.js
  2. +26
    -33
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
  3. +4
    -1
      src/pages/User/DetailsPage_Individual/index.js
  4. +21
    -29
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js
  5. +4
    -2
      src/pages/User/DetailsPage_Organization/index.js
  6. +11
    -1
      src/translations/en.json
  7. +11
    -0
      src/translations/zh-CN.json
  8. +11
    -0
      src/translations/zh-HK.json

+ 2
- 2
src/layout/MainLayout/Header/index.js View File

@@ -208,7 +208,7 @@ function Header(props) {
<Link className="manageUser" to={'/orgUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
User Profile
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
@@ -235,7 +235,7 @@ function Header(props) {
<Link className="manageUser" to={'/indUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
User Profile
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>


+ 26
- 33
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js View File

@@ -16,7 +16,9 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import {notifySaveSuccess,} from 'utils/CommonFunction';
import {useIntl} from "react-intl";
import {FormattedMessage, useIntl} from "react-intl";
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst";
import {ThemeProvider} from "@emotion/react";
// ==============================|| DASHBOARD - DEFAULT ||============================== //


@@ -111,63 +113,52 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
<Grid container maxWidth justifyContent="flex-start">
{editMode ?
<>
<Grid item sx={{ mr: 3 }}>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Grid item sx={{ mr: 3 }}>
<Button
size="large"
variant="contained"
onClick={loadDataFun}
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
<Typography variant="h5">Reset & Back</Typography>
<FormattedMessage id="resetAndBack" />
</Button>
</Grid>

<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
size="large"
variant="contained"
type="submit"
color="success"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
<Typography variant="h5">Save</Typography>
<FormattedMessage id="save" />
</Button>
</Grid>
</ThemeProvider>
</>
:
<>
<Grid item sx={{ mr: 3 }}>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Grid item sx={{ mr: 3 }}>
<Button
size="large"
variant="contained"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
onClick={onEditClick}
>
<Typography variant="h5">Edit</Typography>
<FormattedMessage id="edit" />
</Button>
</Grid>
</ThemeProvider>
</>
}
</Grid>
</Grid>
{/*end top button*/}
<Typography variant="h4" sx={{ mt: 3, mb: 2, borderBottom: "1px solid black" }}>
User Details
<FormattedMessage id="userDetail" />
</Typography>
<Grid item xs={12} sm={12} md={12} lg={12}>
<Grid container>
<Grid item xs={12} sm={12} md={12} lg={4} >
{FieldUtils.getTextField({
label: "Username:",
label: intl.formatMessage({id: 'userLoginName'}) + ":",
valueName: "username",
disabled: true,
form: formik
@@ -176,7 +167,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getTextField({
label: "English Name:",
label: intl.formatMessage({id: 'userEnglishName'}) + ":",
valueName: "enName",
disabled: true,
form: formik
@@ -185,7 +176,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getTextField({
label: "Chinese Name:",
label: intl.formatMessage({id: 'userChineseName'}) + ":",
valueName: "chName",
disabled: true,
form: formik
@@ -194,7 +185,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: "ID Type:",
label: intl.formatMessage({id: 'idType'}) + ":",
valueName: "idDocType",
disabled: true,
dataList: ComboData.idDocType,
@@ -223,7 +214,9 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
<Grid xs={12} sm={12} md={12} lg={4}>
<Grid container alignItems={"center"} sx={{mb:2}}>
<Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
<Typography variant="h5">ID No.:</Typography>
<Typography variant="h5">
<FormattedMessage id="idNo" />:
</Typography>
</Grid>

<Grid item xs={12} sm={12} md={9} lg={6}>
@@ -270,7 +263,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getPhoneField({
label: "Contact Tel:",
label: intl.formatMessage({id: 'userContactNumber'}) + ":",
valueName: {
code: "tel_countryCode",
num: "phoneNumber"
@@ -282,7 +275,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: "Country:",
label: intl.formatMessage({id: 'country'}) + ":",
valueName: "country",
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type }) : "",
dataList: ComboData.country,
@@ -293,7 +286,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getTextField({
label: "Email:",
label: intl.formatMessage({id: 'userContactEmail'}) + ":",
valueName: "emailAddress",
disabled: true,
form: formik
@@ -302,7 +295,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getPhoneField({
label: "Fax No.:",
label: intl.formatMessage({id: 'userFaxNumber'}) + ":",
valueName: {
code: "fax_countryCode",
num: "faxNumber"
@@ -316,7 +309,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getAddressField({
label: "Address:",
label: intl.formatMessage({id: 'userAddress'}) + ":",
valueName: ["addressLine1", "addressLine2", "addressLine3"],
disabled: (!editMode),
form: formik
@@ -325,7 +318,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {

<Grid item xs={12} sm={12} md={12} lg={4}>
{FieldUtils.getComboField({
label: "District:",
label: intl.formatMessage({id: 'district'}) + ":",
valueName: "district",
dataList: ComboData.district,
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type }) : "",


+ 4
- 1
src/pages/User/DetailsPage_Individual/index.js View File

@@ -33,6 +33,7 @@ import {
isINDLoggedIn,
isORGLoggedIn
} from "utils/Utils";
import {FormattedMessage} from "react-intl";
// ==============================|| DASHBOARD - DEFAULT ||============================== //


@@ -126,7 +127,9 @@ const UserMaintainPage_Individual = () => {
{isGLDLoggedIn()?
<Typography ml={15} color='#FFF' variant="h4">Maintain Individual User</Typography>
:
<Typography ml={15} color='#FFF' variant="h4">User Profile</Typography>
<Typography ml={15} color='#FFF' variant="h4">
<FormattedMessage id="userProfile" />
</Typography>
}
</Stack>
</div>


+ 21
- 29
src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js View File

@@ -16,7 +16,9 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifySaveSuccess, } from 'utils/CommonFunction';
import {useIntl} from "react-intl";
import {FormattedMessage, useIntl} from "react-intl";
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst";
import {ThemeProvider} from "@emotion/react";

// import {
// isPrimaryLoggedIn,
@@ -107,51 +109,41 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {
<Grid container maxWidth justifyContent="flex-start">
{editMode ?
<>
<Grid item sx={{ ml: 3, mr: 3 }}>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
size="large"
variant="contained"
onClick={loadDataFun}
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
<Typography variant="h5">Reset & Back</Typography>
<FormattedMessage id="resetAndBack" />

</Button>
</Grid>
<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
size="large"
variant="contained"
type="submit"
color="success"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
>
<Typography variant="h5">Save</Typography>
<FormattedMessage id="save" />

</Button>
</Grid>
</ThemeProvider>
</>
:
<>
<Grid item sx={{ ml: 3, mr: 3 }}>
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Grid item sx={{ ml: 3, mr: 3 }}>
<Button
size="large"
variant="contained"
sx={{
textTransform: 'capitalize',
alignItems: 'end'
}}
onClick={onEditClick}
>
<Typography variant="h5">Edit</Typography>
<FormattedMessage id="edit" />

</Button>
</Grid>
</ThemeProvider>
</>
}

@@ -161,12 +153,12 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {
{/*end top button*/}
<div style={{ paddingLeft: 24, paddingRight: 24 }}>
<Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}>
User Details
<FormattedMessage id="userDetail" />
</Typography>
<Grid container spacing={1}>
<Grid item lg={12}>
{FieldUtils.getTextField({
label: "Username:",
label: intl.formatMessage({id: 'userLoginName'}) + ":",
valueName: "username",
disabled: true,
form: formik
@@ -175,7 +167,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {

<Grid item lg={12}>
{FieldUtils.getTextField({
label: "Name:",
label: intl.formatMessage({id: 'userContactName'}) + ":",
valueName: "contactPerson",
disabled: true,
form: formik
@@ -184,7 +176,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {

<Grid item lg={12}>
{FieldUtils.getTextField({
label: "Email:",
label: intl.formatMessage({id: 'userContactEmail'}) + ":",
valueName: "emailBus",
disabled: true,
form: formik
@@ -193,7 +185,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {

<Grid item lg={12}>
{FieldUtils.getPhoneField({
label: "Contact Tel:",
label: intl.formatMessage({id: 'userContactNumber'}) + ":",
valueName: {
code: "tel_countryCode",
num: "phoneNumber"
@@ -205,7 +197,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {

<Grid item lg={12}>
{FieldUtils.getTextField({
label: "Primary User:",
label: intl.formatMessage({id: 'primaryUser'}) + ":",
valueName: "primaryUser",
disabled: true,
form: formik


+ 4
- 2
src/pages/User/DetailsPage_Organization/index.js View File

@@ -36,7 +36,7 @@ import {
isORGLoggedIn,
isINDLoggedIn
} from "utils/Utils";
import {useIntl} from "react-intl";
import {FormattedMessage, useIntl} from "react-intl";

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -188,7 +188,9 @@ const UserMaintainPage_Organization = () => {
{isGLDLoggedIn()?
<Typography ml={15} color='#FFF' variant="h4">Maintain Organisation User</Typography>
:
<Typography ml={15} color='#FFF' variant="h4">User Profile</Typography>
<Typography ml={15} color='#FFF' variant="h4">
<FormattedMessage id="userProfile" />
</Typography>
}
</Stack>
</div>


+ 11
- 1
src/translations/en.json View File

@@ -59,7 +59,6 @@

"login": "Login",
"logout": "Logout",

"iAmSmartLogin": "iAM Smart Login",
"continueWithIAmSmart": "Continue with iAmSmart",
"authorizeIAmSmartForInfo": "Authorize iAmSmart to provide personal information",
@@ -343,6 +342,17 @@
"viewAllSystemMessage": "Show all messages",
"msgDetails": "Message Details",

"userDetail": "User Details",
"userProfile": "User Profile",
"primaryUser": "Primary User",
"resetAndBack": "Reset & Back",
"edit": "Edit",
"save": "Save",
"idType": " ID Type",
"idNo": "ID No.",
"country": "Country",
"district": "District",

"Dashboard": "Dashboard",
"event": "Event"
}

+ 11
- 0
src/translations/zh-CN.json View File

@@ -342,6 +342,17 @@
"viewAllSystemMessage": "显示所有消息",
"msgDetails": "消息详情",

"userDetail": "用户详细信息",
"userProfile": "用户个人资料",
"primaryUser": "主要用户",
"resetAndBack": "重置并返回",
"edit": "编辑",
"save": "保存",
"idType": "身份证类型",
"idNo": "身份证号码",
"country": "国家",
"district": "区",

"Dashboard": "仪表板",
"event": "活动"
}

+ 11
- 0
src/translations/zh-HK.json View File

@@ -342,6 +342,17 @@
"viewAllSystemMessage": "顯示所有消息",
"msgDetails": "消息詳情",

"userDetail": "使用者詳細資料",
"userProfile": "使用者個人資料",
"primaryUser": "主要使用者",
"resetAndBack": "重置並返回",
"edit": "編輯",
"save": "保存",
"idType": "身分證類型",
"idNo": "身分證號碼",
"country": "國家",
"district": "區",

"Dashboard": "儀表板",
"event": "活動"
}

Loading…
Cancel
Save