diff --git a/public/locales/en/vendor.json b/public/locales/en/vendor.json new file mode 100644 index 0000000..52f97fe --- /dev/null +++ b/public/locales/en/vendor.json @@ -0,0 +1,5 @@ +{ + "report": { + "GetReport": "Get Report" + } +} diff --git a/public/locales/zh/vendor.json b/public/locales/zh/vendor.json new file mode 100644 index 0000000..678650f --- /dev/null +++ b/public/locales/zh/vendor.json @@ -0,0 +1,5 @@ +{ + "report": { + "GetReport": "获取报告" + } +} diff --git a/src/i18n/index.js b/src/i18n/index.js index 10e586c..b787ea2 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -17,7 +17,7 @@ i18n backend: { loadPath: '/locales/{{lng}}/{{ns}}.json', }, - ns: ['common', 'group'], + ns: ['common', 'group', 'vendor'], defaultNS: 'common', detection: { // convertDetectedLanguage: 'Iso15897', diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index 33076ab..a96a3c0 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -5,8 +5,10 @@ import dayjs from 'dayjs'; import SearchForm from '@/components/SearchForm'; import useAuthStore from '@/stores/Auth'; import useReportStore from '@/stores/Report'; +import { useTranslation } from 'react-i18next' function Index() { + const { t } = useTranslation(); const [travelAgencyId, ] = useAuthStore((state) => [state.loginUser.travelAgencyId]); const [loading, vendorScoresData, getHWVendorScores] = useReportStore((state) => [state.loading, state.vendorScoresData, state.getHWVendorScores]); @@ -288,7 +290,7 @@ function Index() { }, fieldComProps: { dates: { picker: 'month', presets: false } }, }} - confirmText={'Get Report'} + confirmText={t('vendor:report.GetReport')} onSubmit={(err, formVal, filedsVal) => { getHWVendorScores(travelAgencyId, formVal.startdate, formVal.enddate); getHWProductScores(travelAgencyId, formVal.startdate, formVal.enddate);