mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Also allow private and direct statuses to be translated
This commit is contained in:
parent
941e86e902
commit
1f3e5b9324
|
@ -180,10 +180,12 @@ class StatusContent extends PureComponent {
|
|||
const contentLocale = intl.locale.replace(/[_-].*/, '');
|
||||
const targetLanguages = languages?.get(status.get('language') || 'und');
|
||||
|
||||
// The Translator API translates all locally on the client, so private and direct toots are fine to translate.
|
||||
const allowedVisibilities = supportsTranslator ? ['public', 'unlisted', 'private', 'direct'] : ['public', 'unlisted'];
|
||||
const shouldAttemptTranslate =
|
||||
this.props.onTranslate &&
|
||||
this.props.identity.signedIn &&
|
||||
['public', 'unlisted'].includes(status.get('visibility')) &&
|
||||
allowedVisibilities.includes(status.get('visibility')) &&
|
||||
status.get('search_index').trim().length > 0;
|
||||
|
||||
if (!shouldAttemptTranslate) return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user