Skip to content

Duplicated reblog count on i18n FormattedMessage #32614

@xatier

Description

@xatier

Steps to reproduce the problem

Since #29585, the UI shows duplicated reblog/favorite counts.

Simply open up a regular toot and see the reblog/favorate box.

Image

Expected behaviour

Having only one counter from the rendered UI

Actual behaviour

Seeing the counters been duplicated.

Detailed description

It's a convention that people on Crowdin translate the i18n string {count, plural, one {boost} other {boosts}} into {count, plural, other {# 則轉嘟}}, where # will be substituted with the value of count. Crowdin also provides the preview UI with the counter to see the substituted strings.

Image

Since the following code been introduced, both the <AnimatedNumber> tag and <FormattedMessage> tag will render the reblogs_count value if the translators follow the convention, which results in duplicated counts in the UI.

We should avoid this pattern in HTML constructs, or should explicitly inform the translators on Crowdin to avoid using # in the translated strings.

        <Link to={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}/reblogs`} className='detailed-status__link'>
          <span className='detailed-status__reblogs'>
            <AnimatedNumber value={status.get('reblogs_count')} />
          </span>
          <FormattedMessage id='status.reblogs' defaultMessage='{count, plural, one {boost} other {boosts}}' values={{ count: status.get('reblogs_count') }} />
        </Link>

Mastodon instance

g0v.social

Mastodon version

v4.3.0

Browser name and version

Edge 131.0.2889.0 (Official build) dev (64-bit)

Operating system

Arch linux

Technical details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions