[Glitch] Fix missing Translate button
Port ceab04a1fddaf1389bd88994af913838a2c04652 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
f6cf58039c
commit
108e3e34b8
@ -69,7 +69,7 @@ class TranslateButton extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
languages: state.server.translationLanguages.items,
|
languages: state.server.translationLanguages.item,
|
||||||
});
|
});
|
||||||
|
|
||||||
class StatusContent extends PureComponent {
|
class StatusContent extends PureComponent {
|
||||||
@ -187,7 +187,7 @@ class StatusContent extends PureComponent {
|
|||||||
|
|
||||||
const renderReadMore = this.props.onClick && status.get('collapsed');
|
const renderReadMore = this.props.onClick && status.get('collapsed');
|
||||||
const contentLocale = intl.locale.replace(/[_-].*/, '');
|
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 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);
|
const content = statusContent ?? getStatusContent(status);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user