Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #3495, Fix pluralization by passing integer time diffs as numbers…
Browse files Browse the repository at this point in the history
…, not strings

The Localized fluent-react component doesn't coerce strings to numbers,
so strings like "1" are mistakenly rendered using the default
pluralization. Bug #3495 is due to our use of the plural as the default
(for example, see the 'timeDiffMinutesAgo' l10n key).
  • Loading branch information
jaredhirsch committed Oct 10, 2017
1 parent ab9d989 commit 3b0a99e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/pages/shot/time-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.TimeDiff = class TimeDiff extends React.Component {
} else {
timeDiff = this.dateString(this.props.date);
}
return <Localized id={timeDiff.l10nID} $number={timeDiff.diff}><span title={this.dateString(this.props.date)}></span></Localized>
return <Localized id={timeDiff.l10nID} $number={this.state.useLocalTime ? parseInt(timeDiff.diff, 10) : timeDiff.diff}><span title={this.dateString(this.props.date)}></span></Localized>
}

componentDidMount() {
Expand Down

0 comments on commit 3b0a99e

Please sign in to comment.