Also allow private and direct statuses to be translated

This commit is contained in:
Thomas Steiner 2025-07-18 15:06:04 +02:00
parent 941e86e902
commit 1f3e5b9324

View File

@ -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;