From 5661e129fbc3537dc8d25fb6a7a57aa00c8424ef Mon Sep 17 00:00:00 2001 From: vjrj Date: Tue, 21 Jul 2026 13:45:59 +0200 Subject: [PATCH] fix: NaN in /fires 'active fires in map' count (react-i18next 14 ) react-i18next 14 reserves `count` as the pluralization variable and no longer interpolates it from a object child, so {{count:N}} 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. --- imports/ui/pages/FiresMap/FiresMap.js | 2 +- public/locales/en/common.json | 2 +- public/locales/es/common.json | 2 +- public/locales/gl/common.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index fb15a05..ab5acd7 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -245,7 +245,7 @@ class FiresMap extends React.Component {

{ (this.props.activefires.length + this.props.firealerts.length) === 0 ? No hay fuegos activos en esta zona del mapa. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. : - En rojo, {{ count: this.props.activefiresunion.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. + En rojo, {{ inMap: this.props.activefiresunion.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. }

{isNotHomeAndMobile() && this.props.firealerts.length > 0 && diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 6ddd231..f0111be 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -73,7 +73,7 @@ "noActiveFireInMapCount": "There are no active fires in this area of the map. <1><0>{{countTotal}} active fires worldwide.", "activeFireInMapCount": - "Marked in red <1><0>{{count,number}} active fires. <3><0>{{countTotal,number}} active fires worldwide.", + "Marked in red <1><0>{{inMap,number}} active fires. <3><0>{{countTotal,number}} 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", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index d46328a..98a5276 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -115,7 +115,7 @@ "noActiveFireInMapCount": "No hay fuegos activos en esta zona del mapa. <1><0>{{countTotal}} fuegos activos en el mundo.", "activeFireInMapCount": - "En rojo, <1><0>{{count,number}} fuegos activos. <3><0>{{countTotal,number}} fuegos activos en el mundo.", + "En rojo, <1><0>{{inMap,number}} fuegos activos. <3><0>{{countTotal,number}} fuegos activos en el mundo.", "activeNeigFireInMapCount": "En naranja, los fuegos notificados por nuestros usuarios/as recientemente.", "Centrar en tu ubicación": diff --git a/public/locales/gl/common.json b/public/locales/gl/common.json index bea98c9..8d1a002 100644 --- a/public/locales/gl/common.json +++ b/public/locales/gl/common.json @@ -67,7 +67,7 @@ "activeFires": "Lumes activos", "Fuegos activos": "Lumes activos", "noActiveFireInMapCount": "Non hai lumes activos nesta zona do mapa. <1><0>{{countTotal}} lumes activos no mundo.", - "activeFireInMapCount": "En vermello, <1><0>{{count,number}} lumes activos. <3><0>{{countTotal,number}} lumes activos no mundo.", + "activeFireInMapCount": "En vermello, <1><0>{{inMap,number}} lumes activos. <3><0>{{countTotal,number}} 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",