Skip to content

Commit

Permalink
Merge pull request #126 from wingkwong/dev
Browse files Browse the repository at this point in the history
Adding missing lang in menu links
  • Loading branch information
wingkwong authored Nov 15, 2019
2 parents 8fe9a0b + 5a7ef38 commit e5f7da2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions web/src/components/organisms/SearchMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
&& {
Expand Down Expand Up @@ -36,13 +37,15 @@ const SearchMenu = props => {
dispatch({ type: DRAWER_CLOSE })
}

const currentLanguage = getCurrentLanguage()

return (
<>
<LeftMargin>
<Typography
variant="h5"
color="secondary"
onClick={() => goToPage('/')}
onClick={() => goToPage(`/${currentLanguage}/`)}
>
{/* 返回首頁 */}
{t('searchMenu.text1')}
Expand All @@ -53,7 +56,7 @@ const SearchMenu = props => {
<Typography
variant="h5"
color="secondary"
onClick={() => goToPage('/district/2019')}
onClick={() => goToPage(`/${currentLanguage}/district/2019`)}
>
{/* 全港選區一覽 */}
{t('searchMenu.text2')}
Expand All @@ -64,7 +67,7 @@ const SearchMenu = props => {
<Typography
variant="h5"
color="secondary"
onClick={() => goToPage('/about-dc')}
onClick={() => goToPage(`/${currentLanguage}/about-dc`)}
>
{/* 關於區議會選舉 */}
{t('searchMenu.text3')}
Expand All @@ -75,7 +78,7 @@ const SearchMenu = props => {
<Typography
variant="h5"
color="secondary"
onClick={() => goToPage('/SelectedDistrict')}
onClick={() => goToPage(`/${currentLanguage}/SelectedDistrict`)}
>
{/* 己關注選區 */}
{t('searchMenu.text4')}
Expand All @@ -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')}
</Typography>
Expand All @@ -101,7 +103,7 @@ const SearchMenu = props => {
<Typography
variant="h5"
color="primary"
onClick={() => goToPage('/about-us')}
onClick={() => goToPage(`/${currentLanguage}/about-us`)}
>
{/* 我們是誰? */}
{t('about.support_us')}
Expand Down
2 changes: 1 addition & 1 deletion web/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import translationZH from 'locales/zh/translation.json'

i18n.use(initReactI18next).init({
fallbackLng: 'zh',
debug: true,
debug: false,
interpolation: {
escapeValue: false,
},
Expand Down

0 comments on commit e5f7da2

Please sign in to comment.