From 69fa1bf2221fd1fe7affd6da33194ad35aaee368 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Mon, 16 Nov 2026 12:46:22 +0400 Subject: [PATCH] i18n: follow-up to the review of the plural and context fixes - The street-level plan step names its place the way show_street_level reads its arguments: a pointed or numbered thing has no place yet, and "this spot" needs both coordinates. - The view-centre error message is removed: the Street Level layer always gives its own translated text for an empty search, so it never showed. "the view centre" is one exported constant for both voice modules. - The orbital site status uses the word of the FOCUS card in es, fr, it, pt and he, and the Wildlife chip agrees with "avistamientos" and "avvistamenti". - CURRENTLY OVER is the noun for an overflight in de, uk, it and pt, shorter than before, so the place name keeps its room on a phone. - The glossaries record the new terms; I18N.md words two rules more exactly. --- docs/I18N.md | 4 +- docs/translations/ar.md | 1 + docs/translations/de.md | 1 + docs/translations/es.md | 2 + docs/translations/fr.md | 2 + docs/translations/he.md | 2 + docs/translations/it.md | 3 ++ docs/translations/pt.md | 5 +- docs/translations/sv.md | 1 + docs/translations/uk.md | 1 + src/i18n/locales/ar.json | 1 - src/i18n/locales/de.json | 3 +- src/i18n/locales/es.json | 5 +- src/i18n/locales/fr.json | 3 +- src/i18n/locales/he.json | 3 +- src/i18n/locales/it.json | 7 ++- src/i18n/locales/ja.json | 1 - src/i18n/locales/pt.json | 5 +- src/i18n/locales/ru.json | 1 - src/i18n/locales/sv.json | 1 - src/i18n/locales/uk.json | 3 +- src/i18n/locales/zh-CN.json | 1 - src/i18n/locales/zh-Hant.json | 1 - src/i18n/same-as-english.json | 1 - .../wildlifeSightings/acquisition.test.mjs | 2 +- src/ui/cockpitOrbitalFocus.test.mjs | 7 ++- src/ui/cockpitOrbitalSignals.js | 2 +- src/voice/gevActions.js | 10 ++-- src/voice/speech.js | 25 ++++----- src/voice/speech.test.mjs | 51 ++++++++++--------- 30 files changed, 80 insertions(+), 75 deletions(-) diff --git a/docs/I18N.md b/docs/I18N.md index d0584920f..f94d30d56 100644 --- a/docs/I18N.md +++ b/docs/I18N.md @@ -87,8 +87,8 @@ menu.onChoose = (code) => switchLocale(code); // switched in place and stored (i - **Pass literals.** `t('Close')`, not `t(label)` (unless `label` holds a `msg()` value) and never a template literal with `${…}`. - **Use placeholders, not concatenation.** `t('Flying to {place}…', { place })`, not `t('Flying to') + ' ' + place`. Word order differs between languages. -- **A placeholder takes a name, not a phrase.** When code has no name to pass and would fall back to a phrase ("the view centre", "this spot"), give that case a message of its own: `t('{source} at the view centre', { source })`. Other languages put a phrase in a different case after a preposition, which a name in its nominative form cannot follow. -- **Use `tn()` for counts**, not `count === 1 ? … : …`. Russian has three forms. That includes a number the English writes with a symbol or abbreviation, so both English forms read the same (`tn(hours, 'Last {hours} h', 'Last {hours} h', { hours })`): other languages inflect the words around it («Última 1 h», «Últimas 24 h»). Fractions have a form of their own too (ru «0,75 МОР. МИЛИ»). +- **Give a fallback phrase its own message.** When code has no name to pass and falls back to a phrase ("the view centre", "this spot"), write `t('{source} at the view centre', { source })`, not `t('{source} at {place}', { place: t('the view centre') })`: after a preposition, other languages put the phrase in a case a separately translated phrase does not have. +- **Use `tn()` for counts**, not `count === 1 ? … : …`. Russian has three forms for whole numbers and a fourth for fractions. That includes a number the English writes with a symbol or abbreviation, so both English forms read the same (`tn(hours, 'Last {hours} h', 'Last {hours} h', { hours: formatNumber(hours) })`): other languages inflect the words around it («Última 1 h», «Últimas 24 h»). Fractions take their own form (ru «0,75 МОР. МИЛИ»). - **Translate the label, not the value.** Layer ids, enums, share-link parameters, API fields, voice tool schemas and feed data (callsigns, vessel and place names) stay as they are; translate only the text shown for them. - **No `t()` at module top level.** Keep the English in `msg()` and call `t()` when rendering. - **Numbers and dates** go through `formatNumber`, `formatDate`, `formatRelativeTime` and `formatUtcDayMonth` from `src/i18n/index.js`, which follow the active language. diff --git a/docs/translations/ar.md b/docs/translations/ar.md index 22d5e5e35..25fe1f1fd 100644 --- a/docs/translations/ar.md +++ b/docs/translations/ar.md @@ -66,6 +66,7 @@ Every form must keep `{count}`. For one and two, Arabic names the quantity with | call sign | رمز النداء | | vessel, ship | سفينة | | satellite | قمر صناعي | +| CONFIRMED (sightings chip; a landing) | مؤكَّدة / مؤكَّد | | launch (rocket) / space mission | إطلاق / مهمة فضائية | | contact (tracked object) | هدف | | installation, site / mapped | منشأة، موقع / مرسوم | diff --git a/docs/translations/de.md b/docs/translations/de.md index 86032a238..fcf7de8fe 100644 --- a/docs/translations/de.md +++ b/docs/translations/de.md @@ -53,6 +53,7 @@ Keep the verb in agreement: «{count} Station meldet» / «{count} Stationen mel | aircraft / flight / military flights | Luftfahrzeug (HUD and short labels: Flugzeug) / Flug / Militärflüge | | vessel, ship | Schiff | | satellite / shell (Starlink) / DENSE | Satellit / Schale / DICHT | +| CURRENTLY OVER (orbit, before a place name) | ÜBERFLUG | | launch (rocket) / launch site / space mission | Start / Startplatz / Raummission | | ascent / replay / payload / stage / downrange | Aufstieg / Replay, Wiedergabe / Nutzlast / Stufe / Downrange | | contact / tracking | Kontakt / Verfolgung | diff --git a/docs/translations/es.md b/docs/translations/es.md index 22a827a64..2e893d969 100644 --- a/docs/translations/es.md +++ b/docs/translations/es.md @@ -45,6 +45,8 @@ The `many` form is the `other` text with «de» after the number: «{count} de c | aircraft, plane / flight / military flights | aeronave / vuelo / vuelos militares | | vessel, ship | buque | | satellite / shell (Starlink) / DENSE | satélite / capa / DENSO | +| FOCUS (the held object; the button) | ENFOQUE / ENFOCAR | +| CONFIRMED (sightings chip; a landing) | CONFIRMADOS / CONFIRMADA | | launch (rocket) / launch site / space mission | lanzamiento / lugar de lanzamiento / misión espacial | | ascent / replay / payload / stage | ascenso / repetición / carga útil / etapa | | contact / tracking | contacto / rastreo | diff --git a/docs/translations/fr.md b/docs/translations/fr.md index e2f506988..9825aa310 100644 --- a/docs/translations/fr.md +++ b/docs/translations/fr.md @@ -49,6 +49,8 @@ The `many` form is the `other` text with « de » (« d' » before a vowel) afte | aircraft / flight / military flights | aéronef (avion in short copy) / vol / vols militaires | | vessel, ship / tanker (AIS type) | navire / navire-citerne | | satellite / shell (Starlink) / DENSE | satellite / couche de la constellation / DENSE | +| FOCUS (the held object; the button) | CENTRÉ / CENTRER | +| CONFIRMED (sightings chip; a landing) | CONFIRMÉES / CONFIRMÉE | | launch / launch site / space mission | lancement / site de lancement / mission spatiale | | ascent / replay / payload / stage / downrange | ascension / rejeu / charge utile / étage / distance au sol (DIST. SOL) | | contact / tracking / track (HUD) | contact / suivi / piste | diff --git a/docs/translations/he.md b/docs/translations/he.md index f6a7d1b14..98f452658 100644 --- a/docs/translations/he.md +++ b/docs/translations/he.md @@ -41,6 +41,8 @@ With {count} shown as a digit, `two` and `other` share the plural noun (2 מצל | aircraft / flight / military flight | מטוס (כלי טיס in class lists) / טיסה / טיסה צבאית | | vessel / ship / ships | אונייה / אוניות | | satellite | לוויין | +| FOCUS (the held object; the button) | מוקד / התמקד | +| CONFIRMED (sightings chip; a landing) | מאושרות / מאושר | | launch (rocket) / space mission | שיגור / משימת חלל | | contact / tracking | מגע / עקיבה | | installation / site | מתקן / אתר | diff --git a/docs/translations/it.md b/docs/translations/it.md index 722916101..75f717310 100644 --- a/docs/translations/it.md +++ b/docs/translations/it.md @@ -52,6 +52,9 @@ The `many` form is the `other` text with «di» after the number when a noun fol | aircraft, plane / flight / military flights | aereo / volo / voli militari | | vessel, ship | nave | | satellite / shell (Starlink) / DENSE | satellite / shell / DENSO | +| FOCUS (the held object; the button) | PUNTAMENTO / FOCUS | +| CONFIRMED (sightings chip; a landing) | CONFERMATI / CONFERMATA | +| CURRENTLY OVER (orbit, before a place name) | SORVOLO | | SPARSE / BALANCED / DENSE (detection modes) | RADO / BILANCIATO / DENSO (agree with «overlay») | | broadband (Starlink shell) | a banda larga | | VISUAL (CelesTrak group) | VISIBILI | diff --git a/docs/translations/pt.md b/docs/translations/pt.md index 682c0a3b9..b10cabe78 100644 --- a/docs/translations/pt.md +++ b/docs/translations/pt.md @@ -57,6 +57,9 @@ The `many` form is the `other` text with «de» after the number: «{count} de c | aircraft, plane / flight / military flights | aeronave, avião / voo / voos militares | | vessel, ship / TANKER (AIS class) | embarcação / NAVIO-TANQUE | | satellite / shell (Starlink) / DENSE | satélite / camada orbital / DENSO | +| FOCUS (the held object; the button) | FOCO / FOCAR | +| CONFIRMED (sightings chip; a landing) | CONFIRMADOS / CONFIRMADA | +| CURRENTLY OVER (orbit, before a place name) | SOBREVOO | | SPARSE / BALANCED / DENSE (detection modes) | ESPARSO / EQUILIBRADO / DENSO (o modo) | | launch (rocket) / launch site / space mission | lançamento / local de lançamento / missão espacial | | KM DOWNRANGE / EST. DOWNRANGE | KM DO LOCAL DE LANÇAMENTO / EST. PELA DIST. DO LANÇAMENTO | @@ -89,7 +92,7 @@ The `many` form is the `other` text with «de» after the number: «{count} de c | detection overlay | sobreposição de detecção | | pin (Draw tool) / box (Recent Imagery) | marcador / área | | Cyber (HUD layout, effect) | Ciber | -| heading / course / altitude / ground speed | rumo / curso / altitude / velocidade solo (VELOC. SOLO) | +| heading / course / altitude / ground speed | rumo / curso (a ship's course: rumo) / altitude / velocidade solo (VELOC. SOLO) | | map heading / bearing (compass, north up) | orientação (do mapa) | | HDG / BRG / CRS / FOV / DEST / SPD / RANGE | HDG / BRG / CRS / FOV / DEST / SPD / RANGE (unchanged) | | V/S (vertical speed code) | V/S (unchanged) | diff --git a/docs/translations/sv.md b/docs/translations/sv.md index 39d7d5aeb..3bdc93cc6 100644 --- a/docs/translations/sv.md +++ b/docs/translations/sv.md @@ -53,6 +53,7 @@ Abbreviated units and codes do not change: «{count} MEDD.». | aircraft / flight / military flights | luftfartyg (short labels: flygplan) / flygning / militärflyg | | vessel, ship | fartyg | | satellite / shell (Starlink) | satellit / skal | +| CONFIRMED (sightings chip; a landing) | BEKRÄFTADE / BEKRÄFTAD | | launch (rocket) / launch site / space mission | uppskjutning / uppskjutningsplats / rymduppdrag | | contact / tracking | kontakt / följning | | installation / site | anläggning / plats | diff --git a/docs/translations/uk.md b/docs/translations/uk.md index cf2ab6373..58a3817c6 100644 --- a/docs/translations/uk.md +++ b/docs/translations/uk.md @@ -45,6 +45,7 @@ A `tn()` entry needs four forms. `Intl.PluralRules('uk')` picks: | aircraft / flight / military flights | літак (short HUD: борт) / рейс / військові рейси | | vessel, ship / vessels | судно / судна (gen. pl. суден) | | satellite | супутник | +| CURRENTLY OVER (orbit, before a place name) | ПРОЛІТ | | launch (rocket) / space mission | запуск / космічна місія | | ascent (rocket) / booster FLIGHT {n} | виведення / ПОЛІТ {n} (not рейс) | | contact / tracking | контакт / стеження | diff --git a/src/i18n/locales/ar.json b/src/i18n/locales/ar.json index bb52515ab..4c6308cb7 100644 --- a/src/i18n/locales/ar.json +++ b/src/i18n/locales/ar.json @@ -3902,7 +3902,6 @@ "{source} imagery could not be opened": "تعذّر فتح صور {source}", "{place} has no position to look for imagery at": "{place}: لا موضع للبحث عن الصور فيه", "No {source} imagery near {place}": "لا توجد صور {source} قرب {place}", - "No {source} imagery near the view centre": "لا توجد صور {source} قرب مركز العرض", "{reason} (filters on: {filters})": "{reason} (المرشحات المفعّلة: {filters})", "tiles unavailable": "البلاطات غير متاحة", "zoom in to load this layer": "قرّب لتحميل هذه الطبقة", diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index ecf459209..f12c3f817 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -315,7 +315,7 @@ "ORBITAL VELOCITY": "BAHNGESCHWINDIGKEIT", "SUB-SATELLITE POINT": "SUBSATELLITENPUNKT", "NORTH UP": "NORDEN OBEN", - "CURRENTLY OVER": "UNTER DEM SATELLITEN", + "CURRENTLY OVER": "ÜBERFLUG", "{division}, {country}": "{division}, {country}", "{region} · near {place}": "{region} · nahe {place}", "NORAD {id}": "NORAD {id}", @@ -3542,7 +3542,6 @@ "{source} imagery could not be opened": "Bilder von {source} konnten nicht geöffnet werden", "{place} has no position to look for imagery at": "{place} hat keine Position, an der nach Bildern gesucht werden kann", "No {source} imagery near {place}": "Keine Bilder von {source} in der Nähe von {place}", - "No {source} imagery near the view centre": "Keine Bilder von {source} in der Nähe der Bildmitte", "{reason} (filters on: {filters})": "{reason} (aktive Filter: {filters})", "tiles unavailable": "Kacheln nicht verfügbar", "zoom in to load this layer": "hineinzoomen, um diese Ebene zu laden", diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index c56f52f3a..8acda94ac 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -571,7 +571,7 @@ "NEAREST": "MÁS CERCANA", "CCTV camera": "Cámara CCTV", "FOCUS": "ENFOCAR", - "site status|FOCUS": "ENFOCADO", + "site status|FOCUS": "ENFOQUE", "COVERAGE OFF": "COBERTURA DESACTIVADA", "AUTO HOP OFF": "SALTO AUTO: NO", "PROJECTION ON": "PROYECCIÓN ACTIVADA", @@ -925,7 +925,7 @@ "awaiting first AIS message…": "esperando el primer mensaje AIS…", "EST. DOWNRANGE": "DIST. ESTIMADA", "CONFIRMED": "CONFIRMADA", - "sightings filter|CONFIRMED": "CONFIRMADAS", + "sightings filter|CONFIRMED": "CONFIRMADOS", "PAD / RTLS": "PLATAFORMA / RTLS", "MISSION CONTROL · FIRST LAUNCH": "CENTRO DE MANDO · PRIMER INICIO", "Choose your first view": "Elige tu primera vista", @@ -3632,7 +3632,6 @@ "{source} imagery could not be opened": "No se pudieron abrir las imágenes de {source}", "{place} has no position to look for imagery at": "{place} no tiene una posición donde buscar imágenes", "No {source} imagery near {place}": "No hay imágenes de {source} cerca de {place}", - "No {source} imagery near the view centre": "No hay imágenes de {source} cerca del centro de la vista", "{reason} (filters on: {filters})": "{reason} (filtros activos: {filters})", "tiles unavailable": "teselas no disponibles", "Environment": "Medio ambiente", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 4d68abcdd..3326c16de 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -600,7 +600,7 @@ "Previous — prior visited contact in the 250 km window": "Précédent — contact visité précédemment dans la fenêtre de 250 km", "PREVIOUS": "PRÉC.", "FOCUS": "CENTRER", - "site status|FOCUS": "VISÉ", + "site status|FOCUS": "CENTRÉ", "Next — nearest unvisited contact in the 250 km window": "Suivant — contact non visité le plus proche dans la fenêtre de 250 km", "NEXT": "SUIV.", "Named areas ({n})": "Zones nommées ({n})", @@ -3632,7 +3632,6 @@ "{source} imagery could not be opened": "Impossible d'ouvrir les images de {source}", "{place} has no position to look for imagery at": "{place} n'a pas de position où chercher des images", "No {source} imagery near {place}": "Aucune image {source} près de {place}", - "No {source} imagery near the view centre": "Aucune image {source} près du centre de la vue", "{reason} (filters on: {filters})": "{reason} (filtres actifs : {filters})", "tiles unavailable": "tuiles indisponibles", "zoom in to load this layer": "zoomez pour charger cette couche", diff --git a/src/i18n/locales/he.json b/src/i18n/locales/he.json index 29c275d90..09ec126a4 100644 --- a/src/i18n/locales/he.json +++ b/src/i18n/locales/he.json @@ -478,7 +478,7 @@ "PREVIOUS": "הקודם", "Previous — prior visited contact in the 250 km window": "הקודם — מגע שכבר ביקרת בו בחלון של 250 ק\"מ", "FOCUS": "התמקד", - "site status|FOCUS": "במוקד", + "site status|FOCUS": "מוקד", "NEXT": "הבא", "Next — nearest unvisited contact in the 250 km window": "הבא — המגע הקרוב ביותר שלא ביקרת בו בחלון של 250 ק\"מ", "Named areas ({n})": "אזורים בעלי שם ({n})", @@ -3632,7 +3632,6 @@ "{source} imagery could not be opened": "לא ניתן היה לפתוח את הצילומים של {source}", "{place} has no position to look for imagery at": "ל-{place} אין מיקום לחיפוש צילומים", "No {source} imagery near {place}": "אין צילומים של {source} ליד {place}", - "No {source} imagery near the view centre": "אין צילומים של {source} ליד מרכז התצוגה", "{reason} (filters on: {filters})": "{reason} (מסננים פעילים: {filters})", "tiles unavailable": "האריחים אינם זמינים", "zoom in to load this layer": "התקרב כדי לטעון את השכבה הזאת", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 10094a30e..669ba160f 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -600,7 +600,7 @@ "Previous — prior visited contact in the 250 km window": "Precedente — contatto visitato in precedenza nella finestra di 250 km", "PREVIOUS": "PREC", "FOCUS": "FOCUS", - "site status|FOCUS": "FOCUS", + "site status|FOCUS": "PUNTAMENTO", "Next — nearest unvisited contact in the 250 km window": "Successivo — contatto non visitato più vicino nella finestra di 250 km", "NEXT": "SUCC", "Named areas ({n})": "Aree con nome ({n})", @@ -958,7 +958,7 @@ "ORBITAL VELOCITY": "VELOCITÀ ORBITALE", "SUB-SATELLITE POINT": "PUNTO SUBSATELLITARE", "NORTH UP": "NORD IN ALTO", - "CURRENTLY OVER": "SOTTO IL SATELLITE", + "CURRENTLY OVER": "SORVOLO", "{division}, {country}": "{division}, {country}", "{region} · near {place}": "{region} · vicino a {place}", "NORAD {id}": "NORAD {id}", @@ -3234,7 +3234,7 @@ "Left panels": "Pannelli a sinistra", "Right panels": "Pannelli a destra", "CONFIRMED": "CONFERMATA", - "sightings filter|CONFIRMED": "CONFERMATE", + "sightings filter|CONFIRMED": "CONFERMATI", "PAD / RTLS": "RAMPA / RTLS", "fire confidence filter|All": "Tutti", "fire confidence filter|Nominal+": "Nominale+", @@ -3632,7 +3632,6 @@ "{source} imagery could not be opened": "Impossibile aprire le immagini di {source}", "{place} has no position to look for imagery at": "{place} non ha una posizione in cui cercare immagini", "No {source} imagery near {place}": "Nessuna immagine di {source} vicino a {place}", - "No {source} imagery near the view centre": "Nessuna immagine di {source} vicino al centro della vista", "{reason} (filters on: {filters})": "{reason} (filtri attivi: {filters})", "tiles unavailable": "tile non disponibili", "zoom in to load this layer": "ingrandisci per caricare questo livello", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index c3bc088f8..50cf52f45 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -3452,7 +3452,6 @@ "{source} imagery could not be opened": "{source}の画像を開けませんでした", "{place} has no position to look for imagery at": "{place}には画像を探す位置がありません", "No {source} imagery near {place}": "{place}の近くに{source}の画像はありません", - "No {source} imagery near the view centre": "表示中心の近くに{source}の画像はありません", "{reason} (filters on: {filters})": "{reason}(有効なフィルター:{filters})", "tiles unavailable": "タイルを利用できません", "zoom in to load this layer": "ズームインしてこのレイヤーを読み込む", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index fb8de411e..fcd49194d 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -600,7 +600,7 @@ "Previous — prior visited contact in the 250 km window": "Anterior — contato visitado anteriormente na janela de 250 km", "PREVIOUS": "ANT.", "FOCUS": "FOCAR", - "site status|FOCUS": "EM FOCO", + "site status|FOCUS": "FOCO", "Next — nearest unvisited contact in the 250 km window": "Próximo — contato não visitado mais próximo na janela de 250 km", "NEXT": "PRÓX.", "Named areas ({n})": "Áreas com nome ({n})", @@ -956,7 +956,7 @@ "ORBITAL VELOCITY": "VELOCIDADE ORBITAL", "SUB-SATELLITE POINT": "PONTO SUBSATÉLITE", "NORTH UP": "NORTE PARA CIMA", - "CURRENTLY OVER": "SOB O SATÉLITE", + "CURRENTLY OVER": "SOBREVOO", "{division}, {country}": "{division}, {country}", "{region} · near {place}": "{region} · perto de {place}", "NORAD {id}": "NORAD {id}", @@ -3632,7 +3632,6 @@ "{source} imagery could not be opened": "Não foi possível abrir as imagens de {source}", "{place} has no position to look for imagery at": "{place} não tem uma posição para buscar imagens", "No {source} imagery near {place}": "Nenhuma imagem de {source} perto de {place}", - "No {source} imagery near the view centre": "Nenhuma imagem de {source} perto do centro da vista", "{reason} (filters on: {filters})": "{reason} (filtros ativos: {filters})", "tiles unavailable": "blocos indisponíveis", "zoom in to load this layer": "aproxime o zoom para carregar esta camada", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 15934dd40..30eee3ffe 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -3722,7 +3722,6 @@ "{source} imagery could not be opened": "Не удалось открыть снимки {source}", "{place} has no position to look for imagery at": "У места «{place}» нет координат для поиска снимков", "No {source} imagery near {place}": "Нет снимков {source} рядом с местом «{place}»", - "No {source} imagery near the view centre": "Нет снимков {source} рядом с центром вида", "{reason} (filters on: {filters})": "{reason} (включены фильтры: {filters})", "tiles unavailable": "тайлы недоступны", "Environment": "Окружающая среда", diff --git a/src/i18n/locales/sv.json b/src/i18n/locales/sv.json index e124eeae9..3c4c1bc4d 100644 --- a/src/i18n/locales/sv.json +++ b/src/i18n/locales/sv.json @@ -3534,7 +3534,6 @@ "{source} imagery could not be opened": "Bilder från {source} kunde inte öppnas", "{place} has no position to look for imagery at": "{place} har ingen position att söka efter bilder vid", "No {source} imagery near {place}": "Inga bilder från {source} nära {place}", - "No {source} imagery near the view centre": "Inga bilder från {source} nära vyns mitt", "{reason} (filters on: {filters})": "{reason} (aktiva filter: {filters})", "1 h/s": "1 h/s", "1 d/s": "1 d/s", diff --git a/src/i18n/locales/uk.json b/src/i18n/locales/uk.json index defb9bc7d..0b472cdf0 100644 --- a/src/i18n/locales/uk.json +++ b/src/i18n/locales/uk.json @@ -977,7 +977,7 @@ "ORBITAL VELOCITY": "ОРБІТАЛЬНА ШВИДКІСТЬ", "SUB-SATELLITE POINT": "ПІДСУПУТНИКОВА ТОЧКА", "NORTH UP": "ПІВНІЧ УГОРІ", - "CURRENTLY OVER": "ПІД СУПУТНИКОМ", + "CURRENTLY OVER": "ПРОЛІТ", "{division}, {country}": "{division}, {country}", "{region} · near {place}": "{region} · поблизу: {place}", "NORAD {id}": "NORAD {id}", @@ -3722,7 +3722,6 @@ "{source} imagery could not be opened": "Не вдалося відкрити знімки {source}", "{place} has no position to look for imagery at": "Для місця «{place}» немає координат для пошуку знімків", "No {source} imagery near {place}": "Немає знімків {source} поблизу: {place}", - "No {source} imagery near the view centre": "Немає знімків {source} поблизу центру карти", "{reason} (filters on: {filters})": "{reason} (увімкнено фільтри: {filters})", "tiles unavailable": "тайли недоступні", "zoom in to load this layer": "наблизьте карту, щоб завантажити цей шар", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 0ca6af0f4..d75599402 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -3452,7 +3452,6 @@ "{source} imagery could not be opened": "无法打开 {source} 影像", "{place} has no position to look for imagery at": "{place} 没有可查找影像的位置", "No {source} imagery near {place}": "{place} 附近没有 {source} 影像", - "No {source} imagery near the view centre": "视图中心附近没有 {source} 影像", "{reason} (filters on: {filters})": "{reason}(已开启筛选:{filters})", "tiles unavailable": "瓦片不可用", "zoom in to load this layer": "放大以加载此图层", diff --git a/src/i18n/locales/zh-Hant.json b/src/i18n/locales/zh-Hant.json index 543caa251..8d09db5a3 100644 --- a/src/i18n/locales/zh-Hant.json +++ b/src/i18n/locales/zh-Hant.json @@ -3452,7 +3452,6 @@ "{source} imagery could not be opened": "無法打開 {source} 影像", "{place} has no position to look for imagery at": "{place} 沒有可查找影像的位置", "No {source} imagery near {place}": "{place} 附近沒有 {source} 影像", - "No {source} imagery near the view centre": "視圖中心附近沒有 {source} 影像", "{reason} (filters on: {filters})": "{reason}(已開啟篩選:{filters})", "tiles unavailable": "瓦片不可用", "zoom in to load this layer": "放大以加載此圖層", diff --git a/src/i18n/same-as-english.json b/src/i18n/same-as-english.json index c975d3ccb..1ab9b364f 100644 --- a/src/i18n/same-as-english.json +++ b/src/i18n/same-as-english.json @@ -685,7 +685,6 @@ "FLIR", "FM MHZ", "FOCUS", - "site status|FOCUS", "FOV", "FOV {value}°", "FT", diff --git a/src/layers/wildlifeSightings/acquisition.test.mjs b/src/layers/wildlifeSightings/acquisition.test.mjs index cbc02f04c..7870c8bc4 100644 --- a/src/layers/wildlifeSightings/acquisition.test.mjs +++ b/src/layers/wildlifeSightings/acquisition.test.mjs @@ -583,7 +583,7 @@ test('the CONFIRMED chip names the sightings, apart from a confirmed launch land setLocale('sv'); assert.equal(h.chip('quality-confirmed').label, 'BEKRÄFTADE'); setLocale('es'); - assert.equal(h.chip('quality-confirmed').label, 'CONFIRMADAS'); + assert.equal(h.chip('quality-confirmed').label, 'CONFIRMADOS'); }); test('a stale fallback with a failed-refresh deadline remains DEGRADED, retryable and dated to the cached data', async () => { diff --git a/src/ui/cockpitOrbitalFocus.test.mjs b/src/ui/cockpitOrbitalFocus.test.mjs index 6a190363d..47e672ec3 100644 --- a/src/ui/cockpitOrbitalFocus.test.mjs +++ b/src/ui/cockpitOrbitalFocus.test.mjs @@ -540,7 +540,12 @@ test('a site row turns the camera onto it, holds it, and reads its off-nadir ang setLocale('es'); await refreshRows(scene); const heldEs = rows(scene).find((row) => row.target?.id === SITES.alpha.id); - assert.match(heldEs.detail, /^ENFOCADO · /); + assert.match(heldEs.detail, /^ENFOQUE · /); + assert.match( + $('#cockpit-orbital-focus').textContent, + /^ENFOQUE · /, + 'the card names the held site with the same word', + ); assert.equal(translate('FOCUS'), 'ENFOCAR', 'the command keeps its verb'); }); diff --git a/src/ui/cockpitOrbitalSignals.js b/src/ui/cockpitOrbitalSignals.js index 04f3a1fc1..49818ea69 100644 --- a/src/ui/cockpitOrbitalSignals.js +++ b/src/ui/cockpitOrbitalSignals.js @@ -132,7 +132,7 @@ function siteRows(info, { settled = true } = {}) { }), }); const words = [installationClassLabel(site.class), angle]; - // A status, not the FOCUS command: es «ENFOCADO», not «ENFOCAR». + // A status, as on the focus card, not the command: es «ENFOQUE», not «ENFOCAR». if (focused) words.unshift(t('FOCUS', { context: 'site status' })); return { key: `site:${site.id}`, diff --git a/src/voice/gevActions.js b/src/voice/gevActions.js index 45b7ae63d..33912b634 100644 --- a/src/voice/gevActions.js +++ b/src/voice/gevActions.js @@ -5,7 +5,11 @@ import { feedProvenanceEnvelope, } from '../data/layerSnapshot.js'; import { readLayerLifecycleSummary } from './layerSummary.js'; -import { SPEECH_BUILDERS, attachVoiceResult } from './speech.js'; +import { + SPEECH_BUILDERS, + VIEW_CENTRE_LABEL, + attachVoiceResult, +} from './speech.js'; import { resolveDeicticArgs } from './deixis.js'; export { readLayerLifecycleSummary } from './layerSummary.js'; import { defaultGeospatial } from '../search/defaults.js'; @@ -3917,13 +3921,11 @@ async function requestStreetLevel( }; // Then the place: a name that geocodes to nothing changes nothing else. - // "the view centre" is English for the model; the card (speech.js) gives - // it messages of its own, since it is a phrase and not a place name. label = query || (entity ? String(entity.label || entity.id) : '') || (hasCoordinates ? `${latitude.toFixed(4)}, ${longitude.toFixed(4)}` : '') || - 'the view centre'; + VIEW_CENTRE_LABEL; atViewCentre = !query && !hasCoordinates && !entity; let point = null; let location = null; diff --git a/src/voice/speech.js b/src/voice/speech.js index d344e493f..a528f4da9 100644 --- a/src/voice/speech.js +++ b/src/voice/speech.js @@ -332,16 +332,6 @@ const ERROR_PATTERNS = [ place: localizePlaceName(place), }), ], - // show_street_level names no place when it looks at the view centre. The - // phrase is not a name: it has a message of its own, so each language - // words it in the case its preposition asks for. - [ - /^No (.+) imagery near the view centre$/, - ([, source]) => - t('No {source} imagery near the view centre', { - source: translateKnown(source), - }), - ], [ /^No (.+) imagery near (.+)$/, ([, source, place]) => @@ -1122,15 +1112,20 @@ export function planStepLabel(name, args = {}) { } case 'show_street_level': { const source = STREET_LEVEL_SOURCE_NAMES[args.provider]; + const query = String(args.query || '').trim(); + // A pointed or numbered thing is found later (deixis): no place yet. + if (query.toLowerCase() === 'pointer' || args.referent != null) + return source || t('Street Level'); // "This spot" and "the view centre" are phrases, not place names: // each is a message of its own, worded in the grammar of the language. - if (args.query) { - const place = shownPlace(args.query, 32); + if (query) { + const place = shownPlace(query, 32); return source ? t('{source} at {place}', { source, place }) : t('Street level at {place}', { place }); } - if (args.latitude != null) + // Coordinates count only as a pair, as show_street_level reads them. + if (args.latitude != null && args.longitude != null) return source ? t('{source} at this spot', { source }) : t('Street level at this spot'); @@ -1212,8 +1207,8 @@ export function narrationLabel(name, args = {}) { } } -/** The place show_street_level reports when it names none (gevActions). */ -const VIEW_CENTRE_LABEL = 'the view centre'; +/** The place show_street_level reports when it names none. */ +export const VIEW_CENTRE_LABEL = 'the view centre'; /** On-screen labels for progress steps. */ const STEP_LABELS = Object.freeze({ diff --git a/src/voice/speech.test.mjs b/src/voice/speech.test.mjs index 7a3cb4050..f92dcd8e8 100644 --- a/src/voice/speech.test.mjs +++ b/src/voice/speech.test.mjs @@ -7,6 +7,7 @@ import { progressLine, progressStepLabel, spokenLabel, + VIEW_CENTRE_LABEL, } from './speech.js'; import { presentResult } from './resultDisplay.js'; import { countWords, findHedges } from './speechLint.js'; @@ -795,35 +796,35 @@ test('the street-level card words "the view centre" and "this spot" as phrases, planStepLabel('show_street_level', { query: 'Alexanderplatz', provider: 'kartaview' }), 'KartaView: Alexanderplatz', ); - const empty = envelope('show_street_level', { - ok: false, - stage: 'imagery', - noImagery: true, - atViewCentre: true, - label: 'the view centre', - providerName: 'Mapillary', - error: 'No Mapillary imagery near the view centre', - }); - assert.deepEqual(empty.display.lines, [ - 'Keine Bilder von Mapillary in der Nähe der Bildmitte', - ]); - assert.equal(empty.say, 'No Mapillary imagery near the view centre.'); - const named = envelope('show_street_level', { - ok: false, - stage: 'imagery', - noImagery: true, - label: 'Alexanderplatz', - providerName: 'Mapillary', - error: 'No Mapillary imagery near Alexanderplatz', - }); - assert.deepEqual(named.display.lines, [ - 'Keine Bilder von Mapillary in der Nähe von Alexanderplatz', - ]); assert.equal( - progressStepLabel('imagery', 'the view centre'), + progressStepLabel('imagery', VIEW_CENTRE_LABEL), `${t('Opening imagery')}: die Bildmitte`, ); } finally { setLocale('en'); } }); + +test('the street-level plan step names the place as show_street_level finds it', () => { + // A pointed or numbered thing is located later, by deixis. + assert.equal(planStepLabel('show_street_level', { referent: 2 }), 'Street Level'); + assert.equal( + planStepLabel('show_street_level', { referent: 2, provider: 'mapillary' }), + 'Mapillary', + ); + assert.equal(planStepLabel('show_street_level', { query: ' Pointer ' }), 'Street Level'); + // One coordinate alone is no spot: the action looks at the view centre. + assert.equal( + planStepLabel('show_street_level', { latitude: 10 }), + 'Street level at the view centre', + ); + setLocale('de'); + try { + assert.equal( + planStepLabel('show_street_level', { referent: 1 }), + 'Straßenebene', + ); + } finally { + setLocale('en'); + } +});