fix: NaN in /fires 'active fires in map' count (react-i18next 14 <Trans>)
react-i18next 14 reserves `count` as the pluralization variable and no
longer interpolates it from a <Trans> object child, so <strong>{{count:N}}</strong>
left {{count,number}} unresolved -> the number formatter ran on undefined ->
"NaN". (t() and the countTotal var were unaffected; regression from the
i18next 10->23 / react-i18next 7->14 bump.)
Renamed the variable count -> inMap in FiresMap.js and in the
activeFireInMapCount value of the es/en/gl locales (the string has no plural
forms, so count was only an unlucky name). Browser-verified: /fires now shows
the real count; home/zones/fire-detail render with no real errors. REST smoke
byte-identical.
This commit is contained in:
parent
6e28bf3545
commit
5661e129fb
4 changed files with 4 additions and 4 deletions
|
|
@ -245,7 +245,7 @@ class FiresMap extends React.Component {
|
|||
<p className="firesmap-legend">
|
||||
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
||||
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment> :
|
||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefiresunion.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ inMap: this.props.activefiresunion.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
||||
}
|
||||
</p>
|
||||
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
"noActiveFireInMapCount":
|
||||
"There are no active fires in this area of the map. <1><0>{{countTotal}}</0></1> active fires worldwide.",
|
||||
"activeFireInMapCount":
|
||||
"Marked in red <1><0>{{count,number}}</0></1> active fires. <3><0>{{countTotal,number}} </0></3> active fires worldwide.",
|
||||
"Marked in red <1><0>{{inMap,number}}</0></1> active fires. <3><0>{{countTotal,number}} </0></3> active fires worldwide.",
|
||||
"activeNeigFireInMapCount": "In Orange, the fires recently reported by our users.",
|
||||
"Centrar en tu ubicación": "Center on your location",
|
||||
"Resaltar en verde el área vigilada por nuestros usuarios/as": "Highlight in green the area monitored by our users",
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
"noActiveFireInMapCount":
|
||||
"No hay fuegos activos en esta zona del mapa. <1><0>{{countTotal}}</0></1> fuegos activos en el mundo.",
|
||||
"activeFireInMapCount":
|
||||
"En rojo, <1><0>{{count,number}}</0></1> fuegos activos. <3><0>{{countTotal,number}}</0></3> fuegos activos en el mundo.",
|
||||
"En rojo, <1><0>{{inMap,number}}</0></1> fuegos activos. <3><0>{{countTotal,number}}</0></3> fuegos activos en el mundo.",
|
||||
"activeNeigFireInMapCount":
|
||||
"En naranja, los fuegos notificados por nuestros usuarios/as recientemente.",
|
||||
"Centrar en tu ubicación":
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
"activeFires": "Lumes activos",
|
||||
"Fuegos activos": "Lumes activos",
|
||||
"noActiveFireInMapCount": "Non hai lumes activos nesta zona do mapa. <1><0>{{countTotal}}</0></1> lumes activos no mundo.",
|
||||
"activeFireInMapCount": "En vermello, <1><0>{{count,number}}</0></1> lumes activos. <3><0>{{countTotal,number}}</0></3> lumes activos no mundo.",
|
||||
"activeFireInMapCount": "En vermello, <1><0>{{inMap,number}}</0></1> lumes activos. <3><0>{{countTotal,number}}</0></3> lumes activos no mundo.",
|
||||
"activeNeigFireInMapCount": "En laranxa, os lumes notificados polas/os nosas/os usuarias/os recentemente.",
|
||||
"Centrar en tu ubicación": "Centrar na túa ubicación",
|
||||
"Resaltar en verde el área vigilada por nuestros usuarios/as": "Resaltar en verde a área vixiada por as/os nosas/os usuarias/os",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue