Skip to content

Commit

Permalink
Merge pull request #1954 from thematters/fix/translation-button
Browse files Browse the repository at this point in the history
*[master]* hoxfix(translate button): fix client language detection of translate button
  • Loading branch information
guoliu authored Apr 5, 2021
2 parents dc1be94 + bc1e2bc commit 4da6017
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/ArticleDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EmptyLayout,
Error,
Head,
LanguageContext,
Layout,
PullToRefresh,
QueryError,
Expand Down Expand Up @@ -143,7 +144,9 @@ const ArticleDetail = () => {
// translation
const [translate, setTranslate] = useState(false)
const language = article?.language
const viewerLanguage = viewer.settings.language

const { lang: viewerLanguage } = useContext(LanguageContext)

const shouldTranslate = language && language !== viewerLanguage

const [
Expand Down

0 comments on commit 4da6017

Please sign in to comment.