about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/status_content.jsx
diff options
context:
space:
mode:
authorChristian Schmidt <github@chsc.dk>2023-03-03 21:06:31 +0100
committerGitHub <noreply@github.com>2023-03-03 21:06:31 +0100
commit5a8c651e8f0252c7135042e79396f782361302d9 (patch)
treee3e0a8c7f1410507a5ce311625e185ac5bdddae8 /app/javascript/mastodon/components/status_content.jsx
parent0872f3e3d743a16533ac4fad4cd83b103047808c (diff)
Only offer translation for supported languages (#23879)
Diffstat (limited to 'app/javascript/mastodon/components/status_content.jsx')
-rw-r--r--app/javascript/mastodon/components/status_content.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx
index a1c38171f..f9c9fe079 100644
--- a/app/javascript/mastodon/components/status_content.jsx
+++ b/app/javascript/mastodon/components/status_content.jsx
@@ -6,7 +6,7 @@ import { Link } from 'react-router-dom';
 import classnames from 'classnames';
 import PollContainer from 'mastodon/containers/poll_container';
 import Icon from 'mastodon/components/icon';
-import { autoPlayGif, languages as preloadedLanguages, translationEnabled } from 'mastodon/initial_state';
+import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_state';
 
 const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top)
 
@@ -220,7 +220,7 @@ class StatusContent extends React.PureComponent {
 
     const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
     const renderReadMore = this.props.onClick && status.get('collapsed');
-    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 renderTranslate = this.props.onTranslate && status.get('translatable');
 
     const content = { __html: status.get('translation') ? status.getIn(['translation', 'content']) : status.get('contentHtml') };
     const spoilerContent = { __html: status.get('spoilerHtml') };