Add translatable_private setting

This commit is contained in:
KMY 2023-09-01 17:30:08 +09:00
parent 05ae3c1948
commit 3cf08a8f4b
8 changed files with 25 additions and 2 deletions

View file

@ -241,7 +241,12 @@ class StatusContent extends PureComponent {
const renderReadMore = this.props.onClick && status.get('collapsed');
const contentLocale = intl.locale.replace(/[_-].*/, '');
const targetLanguages = this.props.languages?.get(status.get('language') || 'und');
const renderTranslate = this.props.onTranslate && this.context.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && status.get('language') && targetLanguages?.includes(contentLocale);
const renderTranslate = this.props.onTranslate &&
this.context.identity.signedIn &&
(['public', 'unlisted'].includes(status.get('visibility')) || status.getIn(['account', 'other_settings', 'translatable_private'])) &&
status.get('search_index').trim().length > 0 &&
status.get('language') &&
targetLanguages?.includes(contentLocale);
const content = { __html: statusContent ?? getStatusContent(status) };
const spoilerContent = { __html: status.getIn(['translation', 'spoilerHtml']) || status.get('spoilerHtml') };