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 | контакт / стеження |