@@ -670,8 +683,8 @@ class Status extends ImmutablePureComponent {
frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
blurhash={attachment.get('blurhash')}
src={attachment.get('url')}
- alt={attachment.get('description')}
- lang={status.get('language')}
+ alt={description}
+ lang={language}
inline
sensitive={status.get('sensitive')}
letterbox={settings.getIn(['media', 'letterbox'])}
@@ -691,7 +704,7 @@ class Status extends ImmutablePureComponent {
{Component => (
);
+ const language = status.getIn(['translation', 'language']) || status.get('language');
+ contentMedia.push();
contentMediaIcons.push('tasks');
}
diff --git a/app/javascript/flavours/glitch/components/status_content.jsx b/app/javascript/flavours/glitch/components/status_content.jsx
index c7fcf37741..9b1e2e0265 100644
--- a/app/javascript/flavours/glitch/components/status_content.jsx
+++ b/app/javascript/flavours/glitch/components/status_content.jsx
@@ -327,11 +327,11 @@ class StatusContent extends PureComponent {
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
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('contentHtml').length > 0 && targetLanguages?.includes(contentLocale);
+ const renderTranslate = this.props.onTranslate && this.context.identity.signedIn && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('search_index').trim().length > 0 && targetLanguages?.includes(contentLocale);
- const content = { __html: status.get('translation') ? status.getIn(['translation', 'content']) : status.get('contentHtml') };
- const spoilerContent = { __html: status.get('spoilerHtml') };
- const lang = status.get('translation') ? intl.locale : status.get('language');
+ const content = { __html: status.getIn(['translation', 'contentHtml']) || status.get('contentHtml') };
+ const spoilerContent = { __html: status.getIn(['translation', 'spoilerHtml']) || status.get('spoilerHtml') };
+ const language = status.getIn(['translation', 'language']) || status.get('language');
const classNames = classnames('status__content', {
'status__content--with-action': parseClick && !disabled,
'status__content--with-spoiler': status.get('spoiler_text').length > 0,
@@ -396,7 +396,7 @@ class StatusContent extends PureComponent {
-
+
{' '}