Use singular 'visitor' when appropriate (#259)

pull/260/head
Uku Taht 6 years ago committed by GitHub
parent 8aa8fe99c4
commit 0d23df0fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,9 +82,10 @@ export default class Countries extends React.Component {
highlightBorderColor: '#a779e9',
popupTemplate: function(geo, data) {
if (!data) { return ; }
const pluralizedLabel = data.numberOfThings === 1 ? label.slice(0, -1) : label
return ['<div class="hoverinfo">',
'<strong>', geo.properties.name, '</strong>',
'<br><strong>', data.numberOfThings, '</strong> ' + label,
'<br><strong>', data.numberOfThings, '</strong> ' + pluralizedLabel,
'</div>'].join('');
}
}

@ -126,7 +126,8 @@ class LineGraph extends React.Component {
const dataset = this._data.datasets[item.datasetIndex]
if (!this.drawnLabels[dataset.label]) {
this.drawnLabels[dataset.label] = true
return ` ${item.yLabel} ${dataset.label}`
const pluralizedLabel = item.yLabel === 1 ? dataset.label.slice(0, -1) : dataset.label
return ` ${item.yLabel} ${pluralizedLabel}`
}
},
footer: function(dataPoints) {

Loading…
Cancel
Save