Fix missing Translate button (#39170)

This commit is contained in:
diondiondion 2026-05-26 16:33:37 +02:00 committed by GitHub
parent c39072ad9d
commit ceab04a1fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,7 @@ class TranslateButton extends PureComponent {
}
const mapStateToProps = state => ({
languages: state.server.translationLanguages.items,
languages: state.server.translationLanguages.item,
});
class StatusContent extends PureComponent {
@ -187,7 +187,7 @@ 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 targetLanguages = this.props.languages?.[status.get('language') || 'und'];
const renderTranslate = this.props.onTranslate && this.props.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && targetLanguages?.includes(contentLocale);
const content = statusContent ?? getStatusContent(status);