diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-10-24 18:30:58 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-11-30 13:53:38 +0100 |
commit | 47bd934061c8f6686bb478d5ea1eaa131bd1d1f9 (patch) | |
tree | 7176c6bddf74a12ed6e23860687fd729f1cd9fd5 /app/javascript/flavours/glitch/components | |
parent | e8d0a1b320713eda76f303b6e840d004f1890d27 (diff) |
[Glitch] Change “Translate” button to only show up when a translation backend is configured
Port 8046cf34d68209b39845e07a9d2db40926cc5512 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/status_content.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index 7c13c7ee4..a510cd24d 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -5,7 +5,7 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import Permalink from './permalink'; import classnames from 'classnames'; import Icon from 'flavours/glitch/components/icon'; -import { autoPlayGif, languages as preloadedLanguages } from 'flavours/glitch/initial_state'; +import { autoPlayGif, languages as preloadedLanguages, translationEnabled } from 'flavours/glitch/initial_state'; import { decode as decodeIDNA } from 'flavours/glitch/utils/idna'; const textMatchesTarget = (text, origin, host) => { @@ -278,7 +278,7 @@ class StatusContent extends React.PureComponent { } = this.props; const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; - const renderTranslate = this.context.identity.signedIn && this.props.onTranslate && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('contentHtml').length > 0 && status.get('language') !== null && intl.locale !== status.get('language'); + const renderTranslate = translationEnabled && this.context.identity.signedIn && this.props.onTranslate && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('contentHtml').length > 0 && status.get('language') !== null && intl.locale !== status.get('language'); const language = preloadedLanguages.find(lang => lang[0] === status.get('language')); const languageName = language ? language[2] : status.get('language'); |