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.
This commit is contained in:
German Khokhlov committed 2026-11-16 12:46:22 +04:00
1 parent 3953421aad
commit 69fa1bf222
30 files changed
+80 -75

No files matched your search

+2 -2
View File
@@ -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.
+1
View File
@@ -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 | منشأة، موقع / مرسوم |
+1
View File
@@ -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 |
+2
View File
@@ -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 |
+2
View File
@@ -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 |
+2
View File
@@ -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 | מתקן / אתר |
+3
View File
@@ -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 |
+4 -1
View File
@@ -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) |
+1
View File
@@ -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 |
+1
View File
@@ -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 | контакт / стеження |
-1
View File
@@ -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": "قرّب لتحميل هذه الطبقة",
+1 -2
View File
@@ -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",
+2 -3
View File
@@ -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",
+1 -2
View File
@@ -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",
+1 -2
View File
@@ -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": "התקרב כדי לטעון את השכבה הזאת",
+3 -4
View File
@@ -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",
-1
View File
@@ -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": "ズームインしてこのレイヤーを読み込む",
+2 -3
View File
@@ -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",
-1
View File
@@ -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": "Окружающая среда",
-1
View File
@@ -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",
+1 -2
View File
@@ -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": "наблизьте карту, щоб завантажити цей шар",
-1
View File
@@ -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": "放大以加载此图层",
-1
View File
@@ -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": "放大以加載此圖層",
-1
View File
@@ -685,7 +685,6 @@
"FLIR",
"FM MHZ",
"FOCUS",
"site status|FOCUS",
"FOV",
"FOV {value}°",
"FT",
@@ -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 () => {
+6 -1
View File
@@ -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');
});
+1 -1
View File
@@ -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}`,
+6 -4
View File
@@ -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;
+10 -15
View File
@@ -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({
+26 -25
View File
@@ -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');
}
});