~cytrogen/masto-fe

42992084872a74cfe6be2b56b35cf3d3cfa69c9f — Christian Schmidt 2 years ago 714a206
Fix `lang` for UI texts in link preview (#26149)

1 files changed, 6 insertions(+), 3 deletions(-)

M app/javascript/mastodon/features/status/components/card.jsx
M app/javascript/mastodon/features/status/components/card.jsx => app/javascript/mastodon/features/status/components/card.jsx +6 -3
@@ 156,9 156,12 @@ export default class Card extends PureComponent {
    const language    = card.get('language') || '';

    const description = (
      <div className='status-card__content' lang={language}>
        <span className='status-card__host'>{provider}{card.get('published_at') && <> · <RelativeTimestamp timestamp={card.get('published_at')} /></>}</span>
        <strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong>
      <div className='status-card__content'>
        <span className='status-card__host'>
          <span lang={language}>{provider}</span>
          {card.get('published_at') && <> · <RelativeTimestamp timestamp={card.get('published_at')} /></>}
         </span>
        <strong className='status-card__title' title={card.get('title')} lang={language}>{card.get('title')}</strong>
        {card.get('author_name').length > 0 && <span className='status-card__author'><FormattedMessage id='link_preview.author' defaultMessage='By {name}' values={{ name: <strong>{card.get('author_name')}</strong> }} /></span>}
      </div>
    );