diff --git a/src/data/installationFeedback.js b/src/data/installationFeedback.js index 4dc1858ddf..cfc1ae6199 100644 --- a/src/data/installationFeedback.js +++ b/src/data/installationFeedback.js @@ -1,6 +1,7 @@ import { msg } from '../i18n/marker.js'; -// installationFeedback() is English data; ui/statusText.js shows it translated. +// installationFeedback() stays English for the analyst. ui/statusText.js and +// ui/shellFeedback.js (HUD) translate it: keep both in step with this wording. const REASONS = Object.freeze({ rate_limited: msg('Overpass rate-limited'), timeout: msg('Overpass timed out'), diff --git a/src/layers/installations/controls.js b/src/layers/installations/controls.js index fe03542055..8c8d729cbe 100644 --- a/src/layers/installations/controls.js +++ b/src/layers/installations/controls.js @@ -259,8 +259,7 @@ export function createControls({ state: layerState, services, parts, source }) { retryAt: layerState.retryAt, retrying: layerState.loading && Boolean(layerState.failureReason), failureReason: layerState.failureReason, - // English data: it is also the analyst's empty note to the model. - // Displays translate it by its shape (ui/statusText.js). + // English: the analyst reads it as is; displays translate it. statusMessage: installationFeedback({ ...layerState, count: layerState.lastUpdate ? mappedCount : undefined, diff --git a/src/layers/installations/installationFeedbackLocale.test.mjs b/src/layers/installations/installationFeedbackLocale.test.mjs index f85a0b3ae5..0591a74eee 100644 --- a/src/layers/installations/installationFeedbackLocale.test.mjs +++ b/src/layers/installations/installationFeedbackLocale.test.mjs @@ -1,6 +1,4 @@ -// getStats().statusMessage is English data (it is also the analyst's empty -// note to the model); the displays show it in the UI language through -// translateStatusPiece (ui/statusText.js). +// statusMessage stays English (the analyst's empty note); displays translate it. import test from 'node:test'; import assert from 'node:assert/strict'; import { setLocale, t, tn, translateKnown } from '../../i18n/index.js'; @@ -26,8 +24,7 @@ function inLocale(locale, run) { } } -// Each layer state, the English statusMessage it reports, and how the UI -// shows it. A retry a minute out reads "60s" (rounded up). +// A retry a minute out reads "60s" (rounded up). const cases = [ [ { status: 'empty', lastUpdate: 1 }, diff --git a/src/ui/statusText.js b/src/ui/statusText.js index 5f4bbf4f2f..8d43ccfbc1 100644 --- a/src/ui/statusText.js +++ b/src/ui/statusText.js @@ -242,10 +242,8 @@ const STATUS_PIECE_PATTERNS = [ ], ]; -// Mapped Installations feedback (installationFeedback in -// data/installationFeedback.js): getStats().statusMessage is English data, and -// the Layers panel, the toast, the awareness panel and the voice card's analyst -// note show it through here. Keep these in step with that helper. +// Shapes of installationFeedback() (data/installationFeedback.js), which stays +// English for the analyst. Keep them in step with its wording. const MAPPED_SITE_PATTERNS = [ [ /^(.+) — retrying in (\d+)s$/, @@ -289,7 +287,7 @@ const MAPPED_SITE_PATTERNS = [ ], ]; -// Every status piece shape, in matching order. +// First match wins. const STATUS_SHAPES = [...STATUS_PIECE_PATTERNS, ...MAPPED_SITE_PATTERNS]; /** A status piece by its shape in the UI language, or null. */