Pluralize messages on more_follows.js
This commit is contained in:
parent
7147cfe662
commit
9323cf1fdf
1 changed files with 7 additions and 16 deletions
|
@ -3,21 +3,13 @@ import PropTypes from 'prop-types';
|
|||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
|
||||
const messages = defineMessages({
|
||||
following_singular: {
|
||||
id: 'morefollows.following_label_singular',
|
||||
defaultMessage: '…and {count} more follow on a remote site.',
|
||||
following: {
|
||||
id: 'morefollows.following_label',
|
||||
defaultMessage: '…and {count} more {count, plural, one {follow} other {follows}} on remote sites.',
|
||||
},
|
||||
following_plural: {
|
||||
id: 'morefollows.following_label_plural',
|
||||
defaultMessage: '…and {count} more follows on remote sites.',
|
||||
},
|
||||
followers_singular: {
|
||||
id: 'morefollows.followers_label_singular',
|
||||
defaultMessage: '…and {count} more follower on a remote site.',
|
||||
},
|
||||
followers_plural: {
|
||||
id: 'morefollows.followers_label_plural',
|
||||
defaultMessage: '…and {count} more followers on remote sites.',
|
||||
followers: {
|
||||
id: 'morefollows.followers_label',
|
||||
defaultMessage: '…and {count} more {count, plural, one {follower} other {followers}} on remote sites.',
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -38,8 +30,7 @@ class MoreFollows extends React.PureComponent {
|
|||
|
||||
getMessage = () => {
|
||||
const { type, count, intl } = this.props;
|
||||
const messageKey = `${type}_${count > 1 ? 'plural' : 'singular'}`;
|
||||
return intl.formatMessage(messages[messageKey], { count });
|
||||
return intl.formatMessage(messages[type], { count });
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue