mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Fixes the P1 and the confirmed P2 findings of the final review of the
i18n branch.
- CI: the air-quality model no longer imports i18n (portable module),
so check:boundaries passes again.
- Air quality layer: named in the layer panel, HUD and voice; its
Weather card, bands and errors translate. A test keeps the layer-name
table in step with the layer registry.
- Layer statuses that still reached ru/es in English: GNSS, CelesTrak,
Transit loading and feed errors, launches, perimeters, ALPR, ECCC,
wind "field unavailable", Local ADS-B streaming lines.
- Voice and HUD: preset ids show city names ("Fly to San Francisco"),
the HUD city translates, cockpit refusals cover frame, aircraft and
satellite; empty Transit notes translate on the analyst card.
- tn() keeps a caller's formatted count ("12,345 map objects").
- Cyber HUD: the language button no longer covers the bottom-right
card or the cockpit position readout.
- CCTV buttons wrap only in non-English locales; English layout matches
main again.
- Switching language asks first when Provider Settings holds unsaved
keys.
Catalogs: es/ru 2611 messages each, complete.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
// A portable export (package.json): no i18n here. Failures stay English data;
|
|
// the Layers panel shows them translated.
|
|
const msg = (text) => text;
|
|
|
|
/** Read launch records and their optional active-orbit catalog with explicit cancellation. */
|
|
export function createLaunchSource({
|
|
fetchImpl = (...args) => globalThis.fetch(...args),
|
|
} = {}) {
|
|
/** The launch payload, and whether the proxy served it from a stale cache. */
|
|
async function getLaunchSnapshot({ signal } = {}) {
|
|
signal?.throwIfAborted();
|
|
const response = await fetchImpl('/api/launches', { signal });
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
const payload = await response.json();
|
|
signal?.throwIfAborted();
|
|
if (!Array.isArray(payload) && !Array.isArray(payload?.results))
|
|
throw new Error(msg('Malformed launch snapshot'));
|
|
return {
|
|
payload,
|
|
stale: response.headers?.get?.('x-gev-cache') === 'STALE-ERROR',
|
|
};
|
|
}
|
|
return {
|
|
getLaunchSnapshot,
|
|
async getLaunches(options) {
|
|
return (await getLaunchSnapshot(options)).payload;
|
|
},
|
|
async getActiveTle({ signal } = {}) {
|
|
signal?.throwIfAborted();
|
|
const response = await fetchImpl('/api/celestrak/active', { signal });
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
const text = await response.text();
|
|
signal?.throwIfAborted();
|
|
return text;
|
|
},
|
|
};
|
|
}
|