Fix `lang` for UI texts in link preview (#26149)

pull/2339/head
Christian Schmidt 2023-07-24 23:01:31 +02:00 committed by GitHub
parent 714a20697f
commit 4299208487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -156,9 +156,12 @@ export default class Card extends PureComponent {
const language = card.get('language') || ''; const language = card.get('language') || '';
const description = ( const description = (
<div className='status-card__content' lang={language}> <div className='status-card__content'>
<span className='status-card__host'>{provider}{card.get('published_at') && <> · <RelativeTimestamp timestamp={card.get('published_at')} /></>}</span> <span className='status-card__host'>
<strong className='status-card__title' title={card.get('title')}>{card.get('title')}</strong> <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>} {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> </div>
); );