整理多语言 namespace

dev/i18n
Lei OT 1 year ago
parent 74d3b79019
commit 458986f1ce

@ -1,71 +0,0 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"menu": {
"Reservation": "Reservation",
"Invoice": "Invoice",
"Feedback": "Feedback",
"Notice": "Notice"
},
"loginAction": {
"ChangePassword": "Change password",
"Profile": "Profile",
"Logout": "Logout",
"ChangeVendor": "Change Vendor",
"LoginTimeout": "Login timeout",
"LoginTimeoutTip": "Please input your password"
},
"common": {
"Search": "Search",
"Reset": "Reset",
"Cancel": "Cancel",
"Submit": "Submit",
"Confirm": "Confirm",
"Close": "Close",
"Save": "Save",
"Edit": "Edit",
"Delete": "Delete",
"Add": "Add",
"View": "View",
"Back": "Back",
"Download": "Download",
"Login": "Login"
},
"form": {
"Username": "Username",
"Password": "Password"
},
"datetime": {
"thisWeek": "This Week",
"lastWeek": "Last Week",
"thisMonth": "This Month",
"lastMonth": "Last Month",
"lastThreeMonth": "Last Three Month",
"thisYear": "This Year"
},
"group": {
"ArrivalDate": "Arrival Date",
"RefNo": "Reference number",
"Pax": "Pax",
"Status": "Status",
"City": "City",
"Guide": "Guide",
"ResSendingDate": "Res. sending date",
"3DGuideTip": "Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.",
"Attachments": "Attachments",
"ConfirmationDate": "Confirmation Date",
"ConfirmationDetails": "Confirmation Details",
"Rate Code": "Rate Code",
"Rate Plan": "Rate Plan",
"Rate Type": "Rate Type",
"Rate Category": "Rate Category",
"Rate Class": "Rate Class",
"Rate Family": "Rate Family",
"Rate Group": "Rate Group",
"Rate Sub Group": "Rate Sub Group",
"Rate Sub Group Code": "Rate Sub Group Code"
}
}

@ -0,0 +1,47 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"Search": "Search",
"Reset": "Reset",
"Cancel": "Cancel",
"Submit": "Submit",
"Confirm": "Confirm",
"Close": "Close",
"Save": "Save",
"Edit": "Edit",
"Delete": "Delete",
"Add": "Add",
"View": "View",
"Back": "Back",
"Download": "Download",
"Upload": "Upload",
"preview": "Preview",
"Login": "Login",
"Username": "Username",
"Password": "Password",
"ChangePassword": "Change password",
"Profile": "Profile",
"Logout": "Logout",
"ChangeVendor": "Change Vendor",
"LoginTimeout": "Login timeout",
"LoginTimeoutTip": "Please input your password",
"datetime": {
"thisWeek": "This Week",
"lastWeek": "Last Week",
"thisMonth": "This Month",
"lastMonth": "Last Month",
"lastThreeMonth": "Last Three Month",
"thisYear": "This Year"
},
"menu": {
"Reservation": "Reservation",
"Invoice": "Invoice",
"Feedback": "Feedback",
"Notice": "Notice"
}
}

@ -0,0 +1,15 @@
{
"ArrivalDate": "Arrival Date",
"RefNo": "Reference number",
"Pax": "Pax",
"Status": "Status",
"City": "City",
"Guide": "Guide",
"ResSendingDate": "Res. sending date",
"3DGuideTip": "Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.",
"Attachments": "Attachments",
"ConfirmationDate": "Confirmation Date",
"ConfirmationDetails": "Confirmation Details",
"#": "#"
}

@ -1,63 +0,0 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"menu": {
"Reservation": "团预订",
"Invoice": "账单",
"Feedback": "反馈表",
"Notice": "通知"
},
"loginAction": {
"ChangePassword": "修改密码",
"Profile": "账户中心",
"Logout": "退出",
"ChangeVendor": "切换账户",
"LoginTimeout": "登录超时",
"LoginTimeoutTip": "请输入密码"
},
"common": {
"Search": "查询",
"Reset": "重置",
"Cancel": "取消",
"Submit": "提交",
"Confirm": "确认",
"Close": "关闭",
"Save": "保存",
"Edit": "编辑",
"Delete": "删除",
"Add": "添加",
"View": "查看",
"Back": "返回",
"Download": "下载",
"Login": "登录"
},
"form": {
"Username": "账户名",
"Password": "密码"
},
"datetime": {
"thisWeek": "本周",
"lastWeek": "上周",
"thisMonth": "本月",
"lastMonth": "上月",
"lastThreeMonth": "前三个月",
"thisYear": "今年"
},
"group": {
"ArrivalDate": "抵达日期",
"RefNo": "团号",
"Pax": "人数",
"Status": "状态",
"City": "城市",
"Guide": "导游",
"ResSendingDate": "发送时间",
"3DGuideTip": "红色突出显示:抵达日期在 3 天内,没有导游信息的预订。",
"Attachments": "附件",
"ConfirmationDate": "确认日期",
"ConfirmationDetails": "确认信息",
"Rate Code": "Rate Code"
}
}

@ -0,0 +1,47 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"Search": "查询",
"Reset": "重置",
"Cancel": "取消",
"Submit": "提交",
"Confirm": "确认",
"Close": "关闭",
"Save": "保存",
"Edit": "编辑",
"Delete": "删除",
"Add": "添加",
"View": "查看",
"Back": "返回",
"Download": "下载",
"Upload": "上传",
"preview": "预览",
"Login": "登录",
"Username": "账户名",
"Password": "密码",
"ChangePassword": "修改密码",
"Profile": "账户中心",
"Logout": "退出",
"ChangeVendor": "切换账户",
"LoginTimeout": "登录超时",
"LoginTimeoutTip": "请输入密码",
"datetime": {
"thisWeek": "本周",
"lastWeek": "上周",
"thisMonth": "本月",
"lastMonth": "上月",
"lastThreeMonth": "前三个月",
"thisYear": "今年"
},
"menu": {
"Reservation": "团预订",
"Invoice": "账单",
"Feedback": "反馈表",
"Notice": "通知"
}
}

@ -0,0 +1,15 @@
{
"ArrivalDate": "抵达日期",
"RefNo": "团号",
"Pax": "人数",
"Status": "状态",
"City": "城市",
"Guide": "导游",
"ResSendingDate": "发送时间",
"3DGuideTip": "红色突出显示:抵达日期在 3 天内,没有导游信息的预订。",
"Attachments": "附件",
"ConfirmationDate": "确认日期",
"ConfirmationDetails": "确认信息",
"#": "#"
}

@ -15,8 +15,10 @@ i18n
// https://www.i18next.com/overview/configuration-options
.init({
backend: {
loadPath: '/locales/{{lng}}.json',
loadPath: '/locales/{{lng}}/{{ns}}.json',
},
ns: ['common', 'group'],
defaultNS: 'common',
// detection: {
// convertDetectedLanguage: 'Iso15897',
// convertDetectedLanguage: (lng) => lng.replace('-', '_')

@ -1,71 +0,0 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"menu": {
"Reservation": "Reservation",
"Invoice": "Invoice",
"Feedback": "Feedback",
"Notice": "Notice"
},
"loginAction": {
"ChangePassword": "Change password",
"Profile": "Profile",
"Logout": "Logout",
"ChangeVendor": "Change Vendor",
"LoginTimeout": "Login timeout",
"LoginTimeoutTip": "Please input your password"
},
"common": {
"Search": "Search",
"Reset": "Reset",
"Cancel": "Cancel",
"Submit": "Submit",
"Confirm": "Confirm",
"Close": "Close",
"Save": "Save",
"Edit": "Edit",
"Delete": "Delete",
"Add": "Add",
"View": "View",
"Back": "Back",
"Download": "Download",
"Login": "Login"
},
"form": {
"Username": "Username",
"Password": "Password"
},
"datetime": {
"thisWeek": "This Week",
"lastWeek": "Last Week",
"thisMonth": "This Month",
"lastMonth": "Last Month",
"lastThreeMonth": "Last Three Month",
"thisYear": "This Year"
},
"group": {
"ArrivalDate": "Arrival Date",
"RefNo": "Reference number",
"Pax": "Pax",
"Status": "Status",
"City": "City",
"Guide": "Guide",
"ResSendingDate": "Res. sending date",
"3DGuideTip": "Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.",
"Attachments": "Attachments",
"ConfirmationDate": "Confirmation Date",
"ConfirmationDetails": "Confirmation Details",
"Rate Code": "Rate Code",
"Rate Plan": "Rate Plan",
"Rate Type": "Rate Type",
"Rate Category": "Rate Category",
"Rate Class": "Rate Class",
"Rate Family": "Rate Family",
"Rate Group": "Rate Group",
"Rate Sub Group": "Rate Sub Group",
"Rate Sub Group Code": "Rate Sub Group Code"
}
}

@ -1,63 +0,0 @@
{
"lang": {
"en": "English",
"zh": "中文"
},
"menu": {
"Reservation": "团预订",
"Invoice": "账单",
"Feedback": "反馈表",
"Notice": "通知"
},
"loginAction": {
"ChangePassword": "修改密码",
"Profile": "账户中心",
"Logout": "退出",
"ChangeVendor": "切换账户",
"LoginTimeout": "登录超时",
"LoginTimeoutTip": "请输入密码"
},
"common": {
"Search": "查询",
"Reset": "重置",
"Cancel": "取消",
"Submit": "提交",
"Confirm": "确认",
"Close": "关闭",
"Save": "保存",
"Edit": "编辑",
"Delete": "删除",
"Add": "添加",
"View": "查看",
"Back": "返回",
"Download": "下载",
"Login": "登录"
},
"form": {
"Username": "账户名",
"Password": "密码"
},
"datetime": {
"thisWeek": "本周",
"lastWeek": "上周",
"thisMonth": "本月",
"lastMonth": "上月",
"lastThreeMonth": "前三个月",
"thisYear": "今年"
},
"group": {
"ArrivalDate": "抵达日期",
"RefNo": "团号",
"Pax": "人数",
"Status": "状态",
"City": "城市",
"Guide": "导游",
"ResSendingDate": "发送时间",
"3DGuideTip": "红色突出显示:抵达日期在 3 天内,没有导游信息的预订。",
"Attachments": "附件",
"ConfirmationDate": "确认日期",
"ConfirmationDetails": "确认信息",
"Rate Code": "Rate Code"
}
}

@ -11,14 +11,12 @@ import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config";
import Language from "../i18n/LanguageSwitcher";
import { useTranslation } from 'react-i18next';
import i18n from '@/i18n/index';
import zhLocale from 'antd/locale/zh_CN';
import enLocale from 'antd/locale/en_US';
import 'dayjs/locale/zh-cn';
const { Header, Content, Footer } = Layout;
const { Title } = Typography;
// const { t } = useTranslation();
let items = [];
@ -28,10 +26,10 @@ const useItemDefault = () => {
useEffect(() => {
const newData = [
{ label: <Link to='/account/change-password'>{t('loginAction.ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('loginAction.Profile')}</Link>, key: '1' },
{ label: <Link to='/account/change-password'>{t('ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('Profile')}</Link>, key: '1' },
{ type: 'divider' },
{ label: <Link to='/login?out'>{t('loginAction.Logout')}</Link>, key: '3' },
{ label: <Link to='/login?out'>{t('Logout')}</Link>, key: '3' },
];
setData(newData);
}, [i18n.language]);
@ -45,11 +43,11 @@ const useItemManager = () => {
useEffect(() => {
const newData = [
{ label: <Link to='/account/change-password'>{t('loginAction.ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('loginAction.Profile')}</Link>, key: '1' },
{ label: <Link to='/account/change-password'>{t('ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('Profile')}</Link>, key: '1' },
{ type: 'divider' },
{ label: <Link to='/login?out'>{t('loginAction.Logout')}</Link>, key: '3' },
{ label: <Link to='/account/change-vendor'>{t('loginAction.ChangeVendor')}</Link>, key: '4' },
{ label: <Link to='/login?out'>{t('Logout')}</Link>, key: '3' },
{ label: <Link to='/account/change-vendor'>{t('ChangeVendor')}</Link>, key: '4' },
];
setData(newData);
}, [i18n.language]);
@ -57,7 +55,7 @@ const useItemManager = () => {
};
function App() {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const items_default = useItemDefault();
const item_manager = useItemManager();
@ -144,8 +142,8 @@ function App() {
footer={null}
open={login.timeout}
>
<Title level={3}>{t('loginAction.LoginTimeout')}</Title>
<div>{t('loginAction.LoginTimeoutTip')}</div>
<Title level={3}>{t('LoginTimeout')}</Title>
<div>{t('LoginTimeoutTip')}</div>
<Space direction="horizontal">
<Input.Password value={password}
onChange={(e) => setPassword(e.target.value)}
@ -153,7 +151,7 @@ function App() {
addonBefore={login.username} />
<Button
onClick={() => onSubmit()}
>{t('common.Submit')}</Button></Space>
>{t('Submit')}</Button></Space>
</Modal>
<Layout

@ -79,7 +79,7 @@ function Login() {
autoComplete="off"
>
<Form.Item
label={t("form.Username")}
label={t("Username")}
name="username"
rules={[
{
@ -91,7 +91,7 @@ function Login() {
<Input />
</Form.Item>
<Form.Item
label={t("form.Password")}
label={t("Password")}
name="password"
rules={[
{
@ -109,7 +109,7 @@ function Login() {
}}
>
<Button type="primary" htmlType="submit" style={{width: "100%"}}>
{t('common.Login')}
{t('Login')}
</Button>
</Form.Item>
</Form>

@ -21,19 +21,19 @@ function Detail() {
dataIndex: 'PCI_Changetext',
},
{
title: t('group.ResSendingDate'),
title: t('group:ResSendingDate'),
dataIndex: 'PCI_SendDate',
},
{
title: t('group.ConfirmationDetails'),
title: t('group:ConfirmationDetails'),
render: detailTextRender
},
{
title: t('group.Attachments'),
title: t('group:Attachments'),
render: attachmentRender
},
{
title: t('group.ConfirmationDate'),
title: t('group:ConfirmationDate'),
dataIndex: 'PCI_ConfirmDate',
},
{
@ -65,7 +65,7 @@ function Detail() {
function confirmRender(text, confirm) {
return (
<Button type="link" onClick={() => showConfirmModal(confirm)}>{t('common.Confirm')}</Button>
<Button type="link" onClick={() => showConfirmModal(confirm)}>{t('Confirm')}</Button>
);
}
@ -134,7 +134,7 @@ function Detail() {
confirmLoading={confirmLoading}
open={isModalOpen} onOk={handleOk} onCancel={handleCancel}
>
<Title level={4}>{t('group.ConfirmationDetails')}</Title>
<Title level={4}>{t('group:ConfirmationDetails')}</Title>
<Paragraph>
<blockquote>
<div style={{whiteSpace: 'pre-line'}}>
@ -155,20 +155,20 @@ function Detail() {
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{ md: 24 }}>
<Col span={20}>
<Title level={4}>{t('group.RefNo')}: {reservationDetail.referenceNumber}; {t('group.ArrivalDate')}: {reservationDetail.arrivalDate};</Title>
<Title level={4}>{t('group:RefNo')}: {reservationDetail.referenceNumber}; {t('group:ArrivalDate')}: {reservationDetail.arrivalDate};</Title>
</Col>
<Col span={4}>
<Button type="link" onClick={() => navigate('/reservation/newest?back')}>{t('common.Back')}</Button>
<Button type="link" onClick={() => navigate('/reservation/newest?back')}>{t('Back')}</Button>
</Col>
</Row>
<Row gutter={{ md: 24 }}>
<Col span={12} style={{height: '100%'}} >
<iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} frameBorder="0" style={{ width: '100%', height: '600px' }}></iframe>
<Button type='link' target='_blank' href={reservationUrl}>{t('common.Download')} Itinerary</Button>
<Button type='link' target='_blank' href={reservationUrl}>{t('Download')} Itinerary</Button>
</Col>
<Col span={12} style={{height: '100%'}} >
<iframe id="msdoc-iframe-name-card" title="msdoc-iframe-name-card" src={nameCardPreviewUrl} frameBorder="0" style={{ width: '100%', height: '600px' }}></iframe>
<Button type='link' target='_blank' href={nameCardUrl}>{t('common.Download')} Name Card</Button>
<Button type='link' target='_blank' href={nameCardUrl}>{t('Download')} Name Card</Button>
</Col>
</Row>
<Row>

@ -17,7 +17,7 @@ function Newest() {
const presets = usePresets();
const reservationListColumns = [
{
title: t('group.RefNo'),
title: t('group:RefNo'),
dataIndex: 'referenceNumber',
key: 'Reference number',
render: (text, record) => {
@ -32,29 +32,29 @@ function Newest() {
},
},
{
title: t('group.ArrivalDate'),
title: t('group:ArrivalDate'),
dataIndex: 'arrivalDate',
key: 'Arrival date',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
},
{
title: t('group.Pax'),
title: t('group:Pax'),
key: 'Pax',
dataIndex: 'pax'
},
{
title: t('group.Status'),
title: t('group:Status'),
key: 'Status',
dataIndex: 'status'
},
{
title: t('group.ResSendingDate'),
title: t('group:ResSendingDate'),
key: 'Reservation date',
dataIndex: 'reservationDate',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
},
{
title: t('group.Guide'),
title: t('group:Guide'),
key: 'Guide',
dataIndex: 'guide',
render: guideRender
@ -65,14 +65,14 @@ function Newest() {
if (reservation.guide === '') {
return (
<Space size="middle">
<Button type="link" onClick={() => showCityGuideModal(reservation)}>{t('common.Add')}</Button>
<Button type="link" onClick={() => showCityGuideModal(reservation)}>{t('Add')}</Button>
</Space>
);
} else {
return (
<Space size="middle">
<span>{reservation.guide}</span>
<Button type="link" onClick={() => showCityGuideModal(reservation)}>{t('common.Edit')}</Button>
<Button type="link" onClick={() => showCityGuideModal(reservation)}>{t('Edit')}</Button>
</Space>
);
}
@ -193,12 +193,12 @@ function Newest() {
pagination={false}
columns={[
{
title: t('group.City'),
title: t('group:City'),
dataIndex: 'cityName',
key: 'cityName'
},
{
title: t('group.Guide'),
title: t('group:Guide'),
dataIndex: 'tourGuide',
key: 'tourGuide',
render: cityGuideRender,
@ -214,11 +214,11 @@ function Newest() {
<Title level={3}></Title>
<Row gutter={16}>
<Col md={24} lg={6} xxl={4}>
<Input placeholder={t("group.RefNo")} value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } />
<Input placeholder={t('group:RefNo')} value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } />
</Col>
<Col md={24} lg={8} xxl={6}>
<Space direction="horizontal">
{t('group.ArrivalDate')}
{t('group:ArrivalDate')}
<DatePicker.RangePicker
allowClear={true}
inputReadOnly={true}
@ -232,14 +232,14 @@ function Newest() {
</Space>
</Col>
<Col md={24} lg={4} xxl={4}>
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>{t('common.Search')}</Button>
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>{t('Search')}</Button>
</Col>
</Row>
<Title level={3}></Title>
<Row>
<Col span={24}>
<Table
title={() => t('group.3DGuideTip')}
title={() => t('group:3DGuideTip')}
bordered
loading={dataLoading}
pagination={{

Loading…
Cancel
Save