diff --git a/web/src/components/organisms/SearchMenu.js b/web/src/components/organisms/SearchMenu.js index 9006b19c..0fa299b9 100644 --- a/web/src/components/organisms/SearchMenu.js +++ b/web/src/components/organisms/SearchMenu.js @@ -7,6 +7,7 @@ import { withRouter } from 'react-router-dom' import ContextStore from 'ContextStore' import { DRAWER_CLOSE } from 'reducers/drawer' import { useTranslation } from 'react-i18next' +import { getCurrentLanguage } from 'utils/helper' const ExpandedRow = styled(Box)` && { @@ -36,13 +37,15 @@ const SearchMenu = props => { dispatch({ type: DRAWER_CLOSE }) } + const currentLanguage = getCurrentLanguage() + return ( <> goToPage('/')} + onClick={() => goToPage(`/${currentLanguage}/`)} > {/* 返回首頁 */} {t('searchMenu.text1')} @@ -53,7 +56,7 @@ const SearchMenu = props => { goToPage('/district/2019')} + onClick={() => goToPage(`/${currentLanguage}/district/2019`)} > {/* 全港選區一覽 */} {t('searchMenu.text2')} @@ -64,7 +67,7 @@ const SearchMenu = props => { goToPage('/about-dc')} + onClick={() => goToPage(`/${currentLanguage}/about-dc`)} > {/* 關於區議會選舉 */} {t('searchMenu.text3')} @@ -75,7 +78,7 @@ const SearchMenu = props => { goToPage('/SelectedDistrict')} + onClick={() => goToPage(`/${currentLanguage}/SelectedDistrict`)} > {/* 己關注選區 */} {t('searchMenu.text4')} @@ -91,7 +94,6 @@ const SearchMenu = props => { 'https://docs.google.com/forms/u/1/d/e/1FAIpQLSdXtbdry3w8hkmZuN0MJaj2CP2X3RUUnCTWLnOujsfx1pHDrw/viewform?usp=send_form') } > - {/* TODO: i18n */} {/* 反映意見 */} {t('searchMenu.feedback')} @@ -101,7 +103,7 @@ const SearchMenu = props => { goToPage('/about-us')} + onClick={() => goToPage(`/${currentLanguage}/about-us`)} > {/* 我們是誰? */} {t('about.support_us')} diff --git a/web/src/i18n.js b/web/src/i18n.js index abc501a4..aa8b3ade 100644 --- a/web/src/i18n.js +++ b/web/src/i18n.js @@ -5,7 +5,7 @@ import translationZH from 'locales/zh/translation.json' i18n.use(initReactI18next).init({ fallbackLng: 'zh', - debug: true, + debug: false, interpolation: { escapeValue: false, },