// @ts-check
import React from 'react';
import { Sparklines, SparklinesCurve } from 'react-sparklines';
-import { FormattedMessage } from 'react-intl';
+import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Permalink from './permalink';
import Skeleton from 'mastodon/components/skeleton';
import classNames from 'classnames';
+const messages = defineMessages({
+ totalVolume: { id: 'hashtag.total_volume', defaultMessage: 'Total volume in the last {days, plural, one {day} other {{days} days}}' },
+});
+
class SilentErrorBoundary extends React.Component {
static propTypes = {
export const accountsCountRenderer = (displayNumber, pluralReady) => (
<FormattedMessage
id='trends.counter_by_accounts'
- defaultMessage='{count, plural, one {{counter} person} other {{counter} people}} talking'
+ defaultMessage='{count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}'
values={{
count: pluralReady,
counter: <strong>{displayNumber}</strong>,
+ days: 2,
}}
/>
);
hashtag: ImmutablePropTypes.map.isRequired,
};
-const Hashtag = ({ name, href, to, people, uses, history, className }) => (
+const Hashtag = injectIntl(({ name, href, to, people, uses, history, className, intl }) => (
<div className={classNames('trends__item', className)}>
<div className='trends__item__name'>
<Permalink href={href} to={to}>
{typeof people !== 'undefined' ? <ShortNumber value={people} renderer={accountsCountRenderer} /> : <Skeleton width={100} />}
</div>
- <div className='trends__item__current'>
+ <abbr className='trends__item__current' title={intl.formatMessage(messages.totalVolume, { days: 2 })}>
{typeof uses !== 'undefined' ? <ShortNumber value={uses} /> : <Skeleton width={42} height={36} />}
- </div>
+ <span className='trends__item__current__asterisk'>*</span>
+ </abbr>
<div className='trends__item__sparkline'>
<SilentErrorBoundary>
</SilentErrorBoundary>
</div>
</div>
-);
+));
Hashtag.propTypes = {
name: PropTypes.string,
{
"descriptors": [
{
- "defaultMessage": "{count, plural, one {{counter} person} other {{counter} people}} talking",
+ "defaultMessage": "Total volume in the last {days, plural, one {day} other {{days} days}}",
+ "id": "hashtag.total_volume"
+ },
+ {
+ "defaultMessage": "{count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}",
"id": "trends.counter_by_accounts"
}
],
],
"path": "app/javascript/mastodon/features/video/index.json"
}
-]
\ No newline at end of file
+]
"hashtag.column_settings.tag_mode.any": "Any of these",
"hashtag.column_settings.tag_mode.none": "None of these",
"hashtag.column_settings.tag_toggle": "Include additional tags for this column",
+ "hashtag.total_volume": "Total volume in the last {days, plural, one {day} other {{days} days}}",
"home.column_settings.basic": "Basic",
"home.column_settings.show_reblogs": "Show boosts",
"home.column_settings.show_replies": "Show replies",
"timeline_hint.resources.followers": "Followers",
"timeline_hint.resources.follows": "Follows",
"timeline_hint.resources.statuses": "Older posts",
- "trends.counter_by_accounts": "{count, plural, one {{counter} person} other {{counter} people}} talking",
+ "trends.counter_by_accounts": "{count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}",
"trends.trending_now": "Trending now",
"ui.beforeunload": "Your draft will be lost if you leave Mastodon.",
"units.short.billion": "{count}B",