Skip to content

Commit

Permalink
Add lang attribute to trending links (mastodon#26111)
Browse files Browse the repository at this point in the history
  • Loading branch information
c960657 authored Jul 24, 2023
1 parent 80809ef commit 76fce34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/javascript/mastodon/features/explore/components/story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class Story extends PureComponent {
static propTypes = {
url: PropTypes.string,
title: PropTypes.string,
lang: PropTypes.string,
publisher: PropTypes.string,
sharedTimes: PropTypes.number,
thumbnail: PropTypes.string,
Expand All @@ -26,15 +27,15 @@ export default class Story extends PureComponent {
handleImageLoad = () => this.setState({ thumbnailLoaded: true });

render () {
const { url, title, publisher, sharedTimes, thumbnail, blurhash } = this.props;
const { url, title, lang, publisher, sharedTimes, thumbnail, blurhash } = this.props;

const { thumbnailLoaded } = this.state;

return (
<a className='story' href={url} target='blank' rel='noopener'>
<div className='story__details'>
<div className='story__details__publisher'>{publisher ? publisher : <Skeleton width={50} />}</div>
<div className='story__details__title'>{title ? title : <Skeleton />}</div>
<div className='story__details__publisher' lang={lang}>{publisher ? publisher : <Skeleton width={50} />}</div>
<div className='story__details__title' lang={lang}>{title ? title : <Skeleton />}</div>
<div className='story__details__shared'>{typeof sharedTimes === 'number' ? <ShortNumber value={sharedTimes} renderer={accountsCountRenderer} /> : <Skeleton width={100} />}</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/features/explore/links.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Links extends PureComponent {
{isLoading ? (<LoadingIndicator />) : links.map(link => (
<Story
key={link.get('id')}
lang={link.get('language')}
url={link.get('url')}
title={link.get('title')}
publisher={link.get('provider_name')}
Expand Down

0 comments on commit 76fce34

Please sign in to comment.