diff --git a/client/scripts/feature-pairs.json b/client/scripts/feature-pairs.json index 9d29fe857..a69a3f6be 100644 --- a/client/scripts/feature-pairs.json +++ b/client/scripts/feature-pairs.json @@ -416,6 +416,12 @@ "desktop": ["src/components/Planner/usePlacesSidebar.ts"], "mobile": ["src/mobile/screens/trip/sheets/ImpListStep.tsx"] }, + { + "feature": "Live flight status", + "hooks": ["src/components/Planner/flightLive/useFlightLiveCard.ts"], + "desktop": ["src/components/Planner/flightLive/FlightLiveCard.tsx", "src/components/Planner/flightLive/FlightLiveStrip.tsx"], + "mobile": ["src/mobile/screens/trip/sheets/MFlightLiveCard.tsx", "src/mobile/screens/trip/MFlightLiveStrip.tsx"] + }, { "feature": "Places column file routing between the Tours and places imports", "hooks": ["src/components/Planner/usePlacesColumnFileImport.ts"], diff --git a/client/src/api/flightLive.ts b/client/src/api/flightLive.ts new file mode 100644 index 000000000..b53db44e9 --- /dev/null +++ b/client/src/api/flightLive.ts @@ -0,0 +1,11 @@ +import apiClient from './client'; + +/** + * GET /api/trips/:tripId/flights/live: the live state of every flight leg of a + * trip TREK can follow. The answer comes back unparsed; store/flightLiveStore.ts + * checks it against the shared contract before anything draws it. + */ +export const flightLiveApi = { + trip: (tripId: number, signal?: AbortSignal): Promise => + apiClient.get(`/trips/${tripId}/flights/live`, { signal }).then((response) => response.data as unknown), +}; diff --git a/client/src/api/wsEventPolicy.ts b/client/src/api/wsEventPolicy.ts index 3aa08c4b8..7ab318b37 100644 --- a/client/src/api/wsEventPolicy.ts +++ b/client/src/api/wsEventPolicy.ts @@ -21,6 +21,8 @@ export const HANDLED_OUTSIDE_TRIP_STORE = [ 'tours:changed', // CW-03: store/tourVisitStore (watchTourVisits) keeps the visits store current. 'tours:visits', + // store/flightLiveStore (watchFlightLive, mounted by useFlightLiveSync) merges live flight states. + 'flight:live', // Collab — Collab/MCollab components + useTripWebSocket's collabFileSync 'collab:note:created', 'collab:note:updated', diff --git a/client/src/components/Map/FlightAircraftLayer.tsx b/client/src/components/Map/FlightAircraftLayer.tsx new file mode 100644 index 000000000..ead4158b0 --- /dev/null +++ b/client/src/components/Map/FlightAircraftLayer.tsx @@ -0,0 +1,51 @@ +import { escapeHtml } from '@trek/shared'; +import L from 'leaflet'; +import { useMemo } from 'react'; +import { Marker, Tooltip } from 'react-leaflet'; +import { frameLng } from '../../utils/lngFrame'; +import { aircraftMarkerHtml, useLiveAircraft, type LiveAircraft } from './flightAircraft'; +import './flightAircraft.css'; +import { useLngFrame } from './lngFrameContext'; + +function aircraftIcon(a: LiveAircraft): L.DivIcon { + return L.divIcon({ + className: '', + html: aircraftMarkerHtml(a, escapeHtml), + iconSize: [30, 30], + iconAnchor: [15, 15], + }); +} + +/** + * The trip's flights in the air, on the Leaflet map: one marker per aircraft + * at its live position, turned to its track. A click opens the booking. + */ +export default function FlightAircraftLayer({ + reservations, + onOpen, +}: { + /** The bookings this map shows; only their aircraft are drawn. */ + reservations: readonly { id: number }[] | undefined; + onOpen?: (reservationId: number) => void; +}) { + const aircraft = useLiveAircraft(reservations); + const frame = useLngFrame(); + const icons = useMemo(() => new Map(aircraft.map((a) => [a.key, aircraftIcon(a)])), [aircraft]); + return ( + <> + {aircraft.map((a) => ( + onOpen?.(a.reservationId) }} + > + + {a.label} + + + ))} + + ); +} diff --git a/client/src/components/Map/MapView.tsx b/client/src/components/Map/MapView.tsx index 3b46e0c26..e38b4f3c7 100644 --- a/client/src/components/Map/MapView.tsx +++ b/client/src/components/Map/MapView.tsx @@ -407,7 +407,7 @@ function TrackCasingPane({ onReady }: { onReady: (ready: boolean) => void }) { import { useMarkerThumbs } from './useMarkerThumbs' import { markerPhotoHtml, placePhotoFull, placePhotoUrl } from './placePhoto' -import { useGeolocation } from '../../hooks/useGeolocation' +import { useGeolocation, type GeoPosition, type TrackingMode } from '../../hooks/useGeolocation' import LocationButton from './LocationButton' import { useIsPhone } from '../../mobile/useIsPhone' import { useIsWide } from '../../hooks/sizeClass' @@ -415,7 +415,6 @@ import { useIsWide } from '../../hooks/sizeClass' // Live-location rendering inside the Leaflet map. Subscribes via the // shared useGeolocation hook so the Leaflet and Mapbox variants behave // identically. Heading is shown as a rotated conic SVG when available. -import type { GeoPosition, TrackingMode } from '../../hooks/useGeolocation' import { SelectionController } from './SelectionController' import { LngFrameProvider, useLngFrame, useTripLngFrame } from './lngFrameContext' import { frameLine, frameLng } from '../../utils/lngFrame' @@ -1078,6 +1077,7 @@ export const MapView = memo(function MapView({ showStats={showReservationStats} onEndpointClick={onReservationClick} roadRoutes={transportRoutes} + aircraftOf={reservations} /> {hazards?.length > 0 && } diff --git a/client/src/components/Map/MapViewGL.tsx b/client/src/components/Map/MapViewGL.tsx index 532aef4f2..7d8f8c59c 100644 --- a/client/src/components/Map/MapViewGL.tsx +++ b/client/src/components/Map/MapViewGL.tsx @@ -23,6 +23,7 @@ import { markerPhotoHtml, placePhotoFull, placePhotoUrl } from './placePhoto' import { isStandardFamily, supportsCustom3d, wantsTerrain, addCustom3dBuildings, addTerrainAndSky } from './mapboxSetup' import { attachLocationMarker, type LocationMarkerHandle } from './locationMarkerMapbox' import { ReservationMapboxOverlay } from './reservationsMapbox' +import { useFlightAircraftGL } from './useFlightAircraftGL' import { useTransportRoutes } from '../../hooks/useTransportRoutes' import { visibleRouteReservations } from '../../utils/reservationRoutes' import { safeHexColor } from '../../utils/safeColor' @@ -1838,22 +1839,19 @@ export function MapViewGL({ useEffect(() => { const map = mapRef.current if (!map || !mapReady) return - if (!reservationOverlayRef.current) { - reservationOverlayRef.current = new ReservationMapboxOverlay(map, { - showConnections: true, - showStats: showReservationStats, - showEndpointLabels, - onEndpointClick: (id) => onReservationClickRef.current?.(id), - }, gl.Marker as any) - } - reservationOverlayRef.current.update(visibleReservations, { + const options = { showConnections: true, showStats: showReservationStats, showEndpointLabels, - onEndpointClick: (id) => onReservationClickRef.current?.(id), - }, transportRoutes) + onEndpointClick: (id: number) => onReservationClickRef.current?.(id), + } + reservationOverlayRef.current ??= new ReservationMapboxOverlay(map, options, gl.Marker as any) + reservationOverlayRef.current.update(visibleReservations, options, transportRoutes) }, [visibleReservations, transportRoutes, showReservationStats, showEndpointLabels, mapReady, glProvider]) + // The trip's flights in the air, as on the Leaflet map. + useFlightAircraftGL(mapRef, mapReady, gl?.Marker, id => onReservationClickRef.current?.(id), reservations) + // Fit bounds on fitKey change — matches the Leaflet BoundsController const paddingOpts = useMemo(() => { if (isMobile) return { top: 40, right: 20, bottom: 40, left: 20 } diff --git a/client/src/components/Map/ReservationOverlay.tsx b/client/src/components/Map/ReservationOverlay.tsx index 89efbe777..c4f4fe648 100644 --- a/client/src/components/Map/ReservationOverlay.tsx +++ b/client/src/components/Map/ReservationOverlay.tsx @@ -11,6 +11,7 @@ import { TRANSPORT_COLOR, TRANSPORT_META, transportHop, type TransportHop, type import type { Reservation } from '../../types' import { frameLine } from '../../utils/lngFrame' import { useLngFrame } from './lngFrameContext' +import FlightAircraftLayer from './FlightAircraftLayer' const ENDPOINT_PANE = 'reservation-endpoints' @@ -69,9 +70,11 @@ interface Props { // Real road-network geometry for car/bus/taxi/bicycle bookings, keyed by // reservation id. When present it is drawn instead of the straight arc. roadRoutes?: Map + // Every booking of the map, drawn or not: the live aircraft of its flights show regardless of the route switch. + aircraftOf?: readonly { id: number }[] } -export default function ReservationOverlay({ reservations, showConnections, onEndpointClick, roadRoutes }: Props) { +export default function ReservationOverlay({ reservations, showConnections, onEndpointClick, roadRoutes, aircraftOf }: Props) { useEndpointPane() const map = useMap() const [zoom, setZoom] = useState(() => map.getZoom()) @@ -117,10 +120,12 @@ export default function ReservationOverlay({ reservations, showConnections, onEn return set }, [visibleItems, zoom, map]) - if (!showConnections) return null + const aircraft = + if (!showConnections) return aircraft return ( <> + {aircraft} {visibleItems.map(item => { if (item.transitSegs.length > 0) { return item.transitSegs.map((seg, segIdx) => ( diff --git a/client/src/components/Map/flightAircraft.css b/client/src/components/Map/flightAircraft.css new file mode 100644 index 000000000..fbf9da2f3 --- /dev/null +++ b/client/src/components/Map/flightAircraft.css @@ -0,0 +1,84 @@ +/* + * A live aircraft on the trip map (flightAircraft.ts). Both renderers position + * the outer element themselves, so the halo animation runs on a child and + * never fights the position. The colour comes in as --trek-aircraft, the + * map's transport colour, so the aircraft matches the flight lines it rides. The marker sits on the map's own colours, not on + * the theme's surfaces, so it stays legible on light and dark basemaps alike. + */ + +@keyframes trek-aircraft-halo { + from { + opacity: 0.55; + transform: scale(0.7); + } + to { + opacity: 0; + transform: scale(1.9); + } +} + +.trek-aircraft { + /* The marker is the disc alone, so the map's centre anchor sits on the aircraft; + the label hangs beside it out of the flow, on the right in either direction. */ + position: relative; + width: 30px; + height: 30px; + direction: ltr; + pointer-events: auto; + cursor: pointer; +} + +.trek-aircraft__halo { + position: absolute; + left: 0; + top: 0; + width: 30px; + height: 30px; + border-radius: 999px; + background: var(--trek-aircraft); + animation: trek-aircraft-halo 2.4s ease-out infinite; +} + +.trek-aircraft__disc { + position: relative; + display: grid; + place-items: center; + width: 30px; + height: 30px; + border-radius: 999px; + background: #fff; + color: var(--trek-aircraft); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28); +} + +.trek-aircraft__label { + position: absolute; + left: 36px; + top: 50%; + transform: translateY(-50%); + padding: 3px 8px; + border-radius: 999px; + background: rgba(17, 24, 39, 0.82); + color: #fff; + font-family: var(--font-system); + font-size: 11px; + font-weight: 700; + letter-spacing: 0.3px; + white-space: nowrap; +} + +.trek-aircraft.is-stale .trek-aircraft__halo { + animation: none; + opacity: 0; +} + +.trek-aircraft.is-stale .trek-aircraft__disc { + opacity: 0.6; +} + +@media (prefers-reduced-motion: reduce) { + .trek-aircraft__halo { + animation: none; + opacity: 0; + } +} diff --git a/client/src/components/Map/flightAircraft.ts b/client/src/components/Map/flightAircraft.ts new file mode 100644 index 000000000..2bc95d2c9 --- /dev/null +++ b/client/src/components/Map/flightAircraft.ts @@ -0,0 +1,79 @@ +import type { FlightLiveLeg } from '@trek/shared'; +import { useMemo } from 'react'; +import { useShallow } from 'zustand/react/shallow'; +import { useFlightLiveStore } from '../../store/flightLiveStore'; +import { useTripStore } from '../../store/tripStore'; +import { TRANSPORT_COLOR } from './transportHops'; + +/** + * The aircraft of a trip's flights that are in the air (or rolling) right now, + * drawn on the trip map by both map engines (FlightAircraftLayer for Leaflet, + * useFlightAircraftGL for Mapbox/MapLibre) from the same markup, so the two + * look alike. + */ +export interface LiveAircraft { + key: string; + reservationId: number; + lat: number; + lng: number; + /** Degrees clockwise from north. */ + track: number; + label: string; + /** Position is old (no signal over an ocean): drawn faded. */ + stale: boolean; +} + +function liveAircraftOf(legs: FlightLiveLeg[]): LiveAircraft[] { + return legs.flatMap((leg) => { + const pos = leg.position; + if (!pos || (leg.phase !== 'airborne' && leg.phase !== 'taxiing')) return []; + return [ + { + key: `${leg.reservation_id}:${leg.leg_index}`, + reservationId: leg.reservation_id, + lat: pos.lat, + lng: pos.lng, + track: pos.track_deg ?? 0, + label: leg.flight_number, + stale: leg.stale, + }, + ]; + }); +} + +const NO_LEGS: FlightLiveLeg[] = []; + +/** + * The open trip's aircraft in the air, limited to the bookings the map was + * handed: the same map component draws collections and tour previews, which + * must not show the last opened trip's flights. Re-renders only when one of + * them moves. + */ +export function useLiveAircraft(reservations: readonly { id: number }[] | undefined): LiveAircraft[] { + const tripId = useTripStore((s) => s.trip?.id); + // The store's own leg objects, so the selection stays equal until one changes. + const legs = useFlightLiveStore( + useShallow((s) => (tripId == null ? NO_LEGS : Object.values(s.trips[tripId]?.legs ?? {}))) + ); + return useMemo(() => { + const ids = new Set((reservations ?? []).map((r) => r.id)); + return ids.size === 0 ? [] : liveAircraftOf(legs).filter((a) => ids.has(a.reservationId)); + }, [legs, reservations]); +} + +/** An airliner seen from above, nose up (north), so `rotate(track)` points it where it flies. */ +const PLANE_PATH = + 'M12 2c.7 0 1.2.8 1.2 1.7v5.6l7.6 4.5v2l-7.6-2.2v4.6l2.3 1.8v1.6L12 20.6l-3.5 1v-1.6l2.3-1.8v-4.6L3.2 15.8v-2l7.6-4.5V3.7C10.8 2.8 11.3 2 12 2Z'; + +/** + * The marker's markup: a white disc with a soft halo, the aircraft turned to + * its track in the map's transport colour, and the flight number on a pill beside it. + * Static text only goes in through `escape`, the caller's HTML escaper. + */ +export function aircraftMarkerHtml(a: LiveAircraft, escape: (s: string) => string): string { + return ``; +} diff --git a/client/src/components/Map/useFlightAircraftGL.ts b/client/src/components/Map/useFlightAircraftGL.ts new file mode 100644 index 000000000..29c42a6c0 --- /dev/null +++ b/client/src/components/Map/useFlightAircraftGL.ts @@ -0,0 +1,72 @@ +import { escapeHtml } from '@trek/shared'; +import { useEffect, useRef } from 'react'; +import { aircraftMarkerHtml, useLiveAircraft } from './flightAircraft'; +import './flightAircraft.css'; + +interface GlMarker { + setLngLat(lngLat: [number, number]): GlMarker; + addTo(map: unknown): GlMarker; + remove(): void; + getElement(): HTMLElement; +} + +/** + * The trip's flights in the air on the Mapbox/MapLibre map: one HTML marker + * per aircraft, moved in place when its position changes and removed when it + * lands. A click opens the booking. The map is read through its ref inside the + * effects, never during render; a rebuilt map (style or provider change) drops + * the markers of the old one. + */ +export function useFlightAircraftGL( + mapRef: { current: unknown }, + mapReady: boolean, + // The map library's Marker class, injected like the other GL overlays do. + Marker: (new (opts: { element: HTMLElement; anchor: string }) => GlMarker) | undefined, + onOpen: (reservationId: number) => void, + /** The bookings this map shows; only their aircraft are drawn. */ + reservations: readonly { id: number }[] | undefined +): void { + const aircraft = useLiveAircraft(reservations); + const markers = useRef(new Map()); + const markersOf = useRef(null); + const openRef = useRef(onOpen); + useEffect(() => { + openRef.current = onOpen; + }); + + useEffect(() => { + const map = mapRef.current; + if (!map || !mapReady || !Marker) return; + if (markersOf.current !== map) { + // The markers belonged to a map that is gone; the new one starts empty. + markers.current.clear(); + markersOf.current = map; + } + const live = new Set(aircraft.map((a) => a.key)); + for (const [key, marker] of markers.current) { + if (!live.has(key)) { + marker.remove(); + markers.current.delete(key); + } + } + for (const a of aircraft) { + let marker = markers.current.get(a.key); + if (!marker) { + const el = document.createElement('div'); + el.addEventListener('click', () => openRef.current(a.reservationId)); + marker = new Marker({ element: el, anchor: 'center' }).setLngLat([a.lng, a.lat]).addTo(map); + markers.current.set(a.key, marker); + } + marker.getElement().innerHTML = aircraftMarkerHtml(a, escapeHtml); + marker.setLngLat([a.lng, a.lat]); + } + }, [aircraft, mapRef, mapReady, Marker]); + + useEffect(() => { + const current = markers.current; + return () => { + for (const marker of current.values()) marker.remove(); + current.clear(); + }; + }, []); +} diff --git a/client/src/components/Notifications/notificationModel.test.tsx b/client/src/components/Notifications/notificationModel.test.tsx index 87e1ea7f5..fafc8bd0e 100644 --- a/client/src/components/Notifications/notificationModel.test.tsx +++ b/client/src/components/Notifications/notificationModel.test.tsx @@ -40,6 +40,7 @@ describe('notificationModel', () => { it('FE-NOTIF-MODEL-001: every known title has its kind, anything else is the plain bell', () => { expect(kindOf('notif.collab_message.title')).toBe('message'); expect(kindOf('notif.replica_failure.title')).toBe('alert'); + expect(kindOf('notif.flight_delayed.title')).toBe('flight'); expect(kindOf('plugin.something.title')).toBe('other'); for (const look of Object.values(KIND_LOOK)) expect(look.tone).toMatch(/^bg-/); }); diff --git a/client/src/components/Notifications/notificationModel.ts b/client/src/components/Notifications/notificationModel.ts index af47586ea..20ad0e8bd 100644 --- a/client/src/components/Notifications/notificationModel.ts +++ b/client/src/components/Notifications/notificationModel.ts @@ -9,6 +9,7 @@ import { MessageCircle, Mountain, Plane, + PlaneTakeoff, Sparkles, Ticket, TriangleAlert, @@ -21,6 +22,7 @@ export type NotificationKind = | 'trip' | 'message' | 'booking' + | 'flight' | 'packing' | 'todo' | 'vacay' @@ -36,6 +38,9 @@ const KIND_BY_TITLE: Record = { 'notif.trip_reminder.title': 'trip', 'notif.collab_message.title': 'message', 'notif.booking_change.title': 'booking', + 'notif.flight_departed.title': 'flight', + 'notif.flight_delayed.title': 'flight', + 'notif.flight_landed.title': 'flight', 'notif.packing_tagged.title': 'packing', 'notif.todo_due.title': 'todo', 'notif.vacay_invite.title': 'vacay', @@ -59,6 +64,7 @@ export const KIND_LOOK: Record { e.preventDefault() e.stopPropagation() @@ -2297,6 +2297,7 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP ) })()} + {transitMeta && (() => { diff --git a/client/src/components/Planner/bookings/BookingCard.tsx b/client/src/components/Planner/bookings/BookingCard.tsx index dcc6bd231..ef91de68b 100644 --- a/client/src/components/Planner/bookings/BookingCard.tsx +++ b/client/src/components/Planner/bookings/BookingCard.tsx @@ -19,6 +19,7 @@ import { fs, toneOf, toneTint, } from './bookingParts' import { TransitLegs, transitSummary } from './transitParts' +import FlightLiveStrip from '../flightLive/FlightLiveStrip' export interface BookingCardProps { r: Reservation @@ -71,6 +72,7 @@ export default function BookingCard(p: BookingCardProps) {
+ {r.type === 'flight' && } {transit ? : ( <> diff --git a/client/src/components/Planner/bookings/BookingDetailDialog.tsx b/client/src/components/Planner/bookings/BookingDetailDialog.tsx index e4beafb89..48c6c45e3 100644 --- a/client/src/components/Planner/bookings/BookingDetailDialog.tsx +++ b/client/src/components/Planner/bookings/BookingDetailDialog.tsx @@ -25,6 +25,9 @@ import { AirTrailPill, BOX, Eyebrow, Field, FileRows, ReviewPill, TravelerChips, import { TransitLegs, transitSummary } from './transitParts' import { BookingDialogHeader, StatusPill, TypePill } from './BookingDialogShell' import { DeleteButton, DialogButton, DialogFooter, DialogSection as Section, DialogShell, FooterSpacer, PILL } from '../../shared/DialogShell' +import { useFlightLiveLegs } from '../../../store/flightLiveStore' +import FlightLiveCard from '../flightLive/FlightLiveCard' +import { getFlightLegs } from '../../../utils/flightLegs' export interface BookingDetailDialogProps { r: Reservation @@ -66,6 +69,9 @@ export default function BookingDetailDialog(p: BookingDetailDialogProps) { const tripCurrency = useTripStore(s => s.trip?.currency) const timeFormat = useSettingsStore(s => s.settings.time_format) || '24h' const [renaming, setRenaming] = useState(false) + // A flight TREK follows live shows its live card instead of the plain time tiles. + const liveLegs = useFlightLiveLegs(p.tripId, r.id) + const legTotal = liveLegs.length > 0 ? getFlightLegs(r).length : 0 const [name, setName] = useState('') const meta = parseMeta(r) const tone = toneOf(r) @@ -84,8 +90,10 @@ export default function BookingDetailDialog(p: BookingDetailDialogProps) { const from = facts.endpoints[0] const to = facts.endpoints[facts.endpoints.length - 1] // Each tile formats its own time: a booking with only an end has no "start → end" line to cut up. - if (facts.startTime) stats.push({ value: formatTime(facts.startTime, locale, timeFormat), label: from?.name || t('reservations.start') }) - if (facts.endTime) stats.push({ value: formatTime(facts.endTime, locale, timeFormat), label: to?.name || t('reservations.end') }) + if (liveLegs.length === 0) { + if (facts.startTime) stats.push({ value: formatTime(facts.startTime, locale, timeFormat), label: from?.name || t('reservations.start') }) + if (facts.endTime) stats.push({ value: formatTime(facts.endTime, locale, timeFormat), label: to?.name || t('reservations.end') }) + } if (transit?.duration) stats.push({ value: fmtTransitDuration(transit.duration, t), label: t('transit.durationLabel') }) if (transit && transit.legs.length > 0) stats.push({ value: String(transit.transfers), label: t('transit.transfersLabel') }) // Under a minute of walking is not worth a tile. @@ -174,6 +182,16 @@ export default function BookingDetailDialog(p: BookingDetailDialogProps) { return ( <> + {liveLegs.map(leg => ( + 1 ? t('flightLive.legOf', { n: leg.leg_index + 1, total: legTotal }) : undefined} + /> + ))} + {stats.length > 0 && (
{stats.map((s, i) => ( diff --git a/client/src/components/Planner/flightLive/FlightArc.tsx b/client/src/components/Planner/flightLive/FlightArc.tsx new file mode 100644 index 000000000..02ed0b612 --- /dev/null +++ b/client/src/components/Planner/flightLive/FlightArc.tsx @@ -0,0 +1,113 @@ +import { useId } from 'react'; + +interface FlightArcProps { + /** Share of the way flown, 0 to 1. */ + progress: number; + /** Draws the aircraft; off where only the route is shown. */ + showPlane: boolean; + /** Softens the aircraft while its position is a guess (stale feed). */ + dimPlane?: boolean; + /** Colours as CSS values, so the desktop and the phone dress it in their own tokens. */ + track: string; + flown: string; + plane: string; + className?: string; +} + +// The arc is a quadratic curve across a fixed box; the SVG scales to its column. +const W = 320; +const H = 74; +const P0 = { x: 14, y: 62 }; +const P1 = { x: W / 2, y: -14 }; +const P2 = { x: W - 14, y: 62 }; + +function pointAt(t: number): { x: number; y: number; angle: number } { + const u = 1 - t; + const x = u * u * P0.x + 2 * u * t * P1.x + t * t * P2.x; + const y = u * u * P0.y + 2 * u * t * P1.y + t * t * P2.y; + const dx = 2 * u * (P1.x - P0.x) + 2 * t * (P2.x - P1.x); + const dy = 2 * u * (P1.y - P0.y) + 2 * t * (P2.y - P1.y); + return { x, y, angle: (Math.atan2(dy, dx) * 180) / Math.PI }; +} + +const PATH = `M${P0.x} ${P0.y} Q${P1.x} ${P1.y} ${P2.x} ${P2.y}`; + +/** An airliner seen from above, nose along +x, about 18 units long. */ +const PLANE = + 'M9 0c0-.9-.7-1.3-1.6-1.3H3.2L-1.6-7.6h-2.1l2.3 6.3h-4.1l-1.7-2.4h-1.6l1 3.7-1 3.7h1.6l1.7-2.4h4.1l-2.3 6.3h2.1l4.8-6.3h4.2C8.3 1.3 9 .9 9 0Z'; + +/** + * The route of a flight as a gentle arc: dashed where it is still to fly, + * solid where it has flown, the aircraft riding the curve at its heading. + * Around the aircraft the lines are masked out rather than covered, so it sits + * cleanly on any card, translucent ones included. In a right-to-left layout + * the origin stands on the right, so the whole drawing is mirrored with it. + * Purely visual; the numbers sit in the card around it. + */ +export default function FlightArc({ + progress, + showPlane, + dimPlane, + track, + flown, + plane, + className = '', +}: FlightArcProps) { + const maskId = useId(); + const p = Math.min(1, Math.max(0, progress)); + const at = pointAt(p); + // A CSS transform rather than the attribute, so a new position glides there. + const placed = { transform: `translate(${at.x}px, ${at.y}px) rotate(${at.angle}deg)` }; + return ( + + ); +} diff --git a/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx b/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx new file mode 100644 index 000000000..e1b5e2793 --- /dev/null +++ b/client/src/components/Planner/flightLive/FlightLiveCard.test.tsx @@ -0,0 +1,201 @@ +// FE-PLANNER-FLIGHTLIVE-001 to FE-PLANNER-FLIGHTLIVE-008 +import type { FlightLiveLeg } from '@trek/shared'; +import { beforeEach, describe, expect, it } from 'vitest'; + +import { render, screen } from '../../../../tests/helpers/render'; +import MFlightLiveStrip, { MPlanFlightLine } from '../../../mobile/screens/trip/MFlightLiveStrip'; +import MFlightLiveCard from '../../../mobile/screens/trip/sheets/MFlightLiveCard'; +import { legKey, useFlightLiveStore } from '../../../store/flightLiveStore'; +import type { Reservation } from '../../../types'; +import FlightArc from './FlightArc'; +import FlightLiveCard from './FlightLiveCard'; +import FlightLiveStrip, { PlanFlightLiveLine } from './FlightLiveStrip'; + +const H = 3_600_000; + +function leg(over: Partial = {}): FlightLiveLeg { + const now = Date.now(); + return { + reservation_id: 6, + leg_index: 0, + callsign: 'DLH400', + flight_number: 'LH 400', + service_date: '2026-06-11', + origin: { code: 'FRA', name: 'Frankfurt', lat: 50.03, lng: 8.57, timezone: 'Europe/Berlin' }, + destination: { code: 'JFK', name: 'New York JFK', lat: 40.64, lng: -73.78, timezone: 'America/New_York' }, + phase: 'airborne', + scheduled_departure: new Date(now - 3 * H).toISOString(), + scheduled_arrival: new Date(now + 5 * H).toISOString(), + departed_at: new Date(now - 3 * H + 40 * 60_000).toISOString(), + landed_at: null, + estimated_arrival: new Date(now + 5 * H + 35 * 60_000).toISOString(), + departure_delay_min: 40, + arrival_delay_min: 35, + progress: 0.4, + distance_total_km: 6200, + distance_remaining_km: 3720, + position: { + lat: 55, + lng: -20, + altitude_ft: 37000, + ground_speed_kt: 470, + track_deg: 285, + vertical_rate_fpm: 0, + on_ground: false, + }, + aircraft: { registration: 'D-AIXA', type: 'A359' }, + last_seen_at: new Date(now - 60_000).toISOString(), + fetched_at: new Date(now - 30_000).toISOString(), + stale: false, + source: 'adsb.lol', + ...over, + }; +} + +function seed(...legs: FlightLiveLeg[]) { + useFlightLiveStore.setState({ + trips: { + 1: { + enabled: true, + attribution: 'Live positions: adsb.lol (ODbL)', + legs: Object.fromEntries(legs.map((l) => [legKey(l.reservation_id, l.leg_index), l])), + }, + }, + }); +} + +beforeEach(() => useFlightLiveStore.setState({ trips: {} })); + +describe('FlightLiveCard', () => { + it('FE-PLANNER-FLIGHTLIVE-001: shows the moment, both airports, the delay and the numbers in the air', () => { + seed(leg()); + render(); + expect(screen.getByText('In the air')).toBeInTheDocument(); + expect(screen.getByText('FRA')).toBeInTheDocument(); + expect(screen.getByText('JFK')).toBeInTheDocument(); + expect(screen.getByText('+35 min')).toBeInTheDocument(); + expect(screen.getByText('Altitude')).toBeInTheDocument(); + expect(screen.getByText('A359 D-AIXA')).toBeInTheDocument(); + expect(screen.getByText('Live positions: adsb.lol (ODbL)')).toBeInTheDocument(); + }); + + it('FE-PLANNER-FLIGHTLIVE-002: renders nothing while TREK follows no state for the leg', () => { + const { container } = render(); + expect(container).toBeEmptyDOMElement(); + }); + + it('FE-PLANNER-FLIGHTLIVE-003: counts down to departure and labels a leg of a longer booking', () => { + const now = Date.now(); + seed( + leg({ + phase: 'scheduled', + scheduled_departure: new Date(now + 26 * H).toISOString(), + departed_at: null, + estimated_arrival: null, + position: null, + progress: null, + departure_delay_min: null, + arrival_delay_min: null, + aircraft: null, + last_seen_at: null, + }) + ); + render(); + expect(screen.getByText(/Departs in 1 d 2 h/)).toBeInTheDocument(); + expect(screen.getByText('Flight 1 of 2')).toBeInTheDocument(); + expect(screen.queryByText('Altitude')).not.toBeInTheDocument(); + }); + + it('FE-PLANNER-FLIGHTLIVE-004: explains a flight the feed cannot find, and the missing gate only around boarding', () => { + seed( + leg({ + phase: 'unknown', + position: null, + progress: null, + departure_delay_min: null, + arrival_delay_min: null, + last_seen_at: null, + }) + ); + const { unmount } = render(); + expect(screen.getByText('No live data')).toBeInTheDocument(); + expect(screen.queryByText(/Gate, terminal and baggage belt/)).not.toBeInTheDocument(); + // Nothing heard, so the feed is not credited either. + expect(screen.queryByText('Live positions: adsb.lol (ODbL)')).not.toBeInTheDocument(); + unmount(); + const now = Date.now(); + seed( + leg({ + phase: 'scheduled', + scheduled_departure: new Date(now + H).toISOString(), + departed_at: null, + position: null, + progress: null, + departure_delay_min: null, + arrival_delay_min: null, + last_seen_at: null, + }) + ); + render(); + expect(screen.getByText(/Gate, terminal and baggage belt/)).toBeInTheDocument(); + }); +}); + +describe('MFlightLiveCard', () => { + it('FE-PLANNER-FLIGHTLIVE-005: lays out the same moment for the phone', () => { + seed(leg()); + render(); + expect(screen.getByText('In the air')).toBeInTheDocument(); + expect(screen.getByText('+35 min')).toBeInTheDocument(); + expect(screen.getByText('JFK')).toBeInTheDocument(); + }); +}); + +describe('strips and plan lines', () => { + it('FE-PLANNER-FLIGHTLIVE-006: the card strips speak for the leg in the air in one line', () => { + seed(leg()); + render( + <> + + {}} /> + + ); + expect(screen.getAllByText(/^In the air, Lands in/)).toHaveLength(2); + }); + + it('FE-PLANNER-FLIGHTLIVE-007: strips and plan lines stay quiet far ahead, and the plan line skips other transports', () => { + const now = Date.now(); + seed( + leg({ + phase: 'scheduled', + scheduled_departure: new Date(now + 26 * H).toISOString(), + departed_at: null, + position: null, + progress: null, + departure_delay_min: null, + arrival_delay_min: null, + }) + ); + const res = { id: 6, type: 'flight' } as Reservation; + const { container } = render( + <> + + + + + + ); + expect(container).toBeEmptyDOMElement(); + }); +}); + +describe('FlightArc', () => { + it('FE-PLANNER-FLIGHTLIVE-008: draws the flown part only once under way, and the aircraft on request', () => { + const { container, rerender } = render( + + ); + expect(container.querySelectorAll('path')).toHaveLength(1); + rerender(); + expect(container.querySelectorAll('path')).toHaveLength(3); + }); +}); diff --git a/client/src/components/Planner/flightLive/FlightLiveCard.tsx b/client/src/components/Planner/flightLive/FlightLiveCard.tsx new file mode 100644 index 000000000..f105dbebc --- /dev/null +++ b/client/src/components/Planner/flightLive/FlightLiveCard.tsx @@ -0,0 +1,142 @@ +import { Info, Radio } from 'lucide-react'; +import { useTranslation } from '../../../i18n'; +import type { DelayTone } from '../../../utils/flightLiveModel'; +import FlightArc from './FlightArc'; +import { useFlightLiveCard, type FlightTimeCell } from './useFlightLiveCard'; + +const DELAY_CHIP: Record = { + ok: 'bg-success-soft text-success', + minor: 'bg-warning-soft text-warning', + major: 'bg-danger-soft text-danger', +}; + +interface FlightLiveCardProps { + tripId: number; + reservationId: number; + legIndex: number; + /** "Flight 2 of 3" above the card, for a booking with stopovers. */ + legLabel?: string; +} + +function TimeBlock({ + code, + city, + cell, + end, +}: { + code: string; + city: string | null; + cell: FlightTimeCell; + end?: boolean; +}) { + return ( +
+ {code} + {city && ( + + {city} + + )} + + {cell.planned && {cell.planned}} + {cell.value} + + {cell.note && {cell.note}} +
+ ); +} + +/** + * A flight's live state in the booking dialog: what is happening now in one + * line, both airports with their times, the route as an arc with the aircraft + * on it, and the numbers of the moment. Renders nothing while TREK follows no + * state for this leg, so the dialog keeps its plain schedule tiles. + */ +export default function FlightLiveCard({ tripId, reservationId, legIndex, legLabel }: FlightLiveCardProps) { + const { t } = useTranslation(); + const card = useFlightLiveCard(tripId, reservationId, legIndex); + if (!card) return null; + const { leg, view } = card; + const quiet = view.stage === 'past' || view.stage === 'unknown'; + + return ( +
+ {legLabel && ( +
+ {legLabel} +
+ )} +
+ + {card.live && ( + + )} + + +
+
{card.headline}
+ {card.detail &&
{card.detail}
} +
+ {card.delay && ( + + {card.delay.text} + + )} +
+ +
+ +
+ + + {leg.flight_number} + +
+ +
+ + {card.stats.length > 0 && ( +
+ {card.stats.map((s) => ( +
+
{s.label}
+
{s.value}
+
+ ))} +
+ )} + + {card.gateHint && ( +

+ + {t('flightLive.noGateHint')} +

+ )} + + {card.footnote && ( +
+ + + {card.footnote} + + {card.attribution && {card.attribution}} +
+ )} +
+ ); +} diff --git a/client/src/components/Planner/flightLive/FlightLiveStrip.tsx b/client/src/components/Planner/flightLive/FlightLiveStrip.tsx new file mode 100644 index 000000000..9b7fff5ee --- /dev/null +++ b/client/src/components/Planner/flightLive/FlightLiveStrip.tsx @@ -0,0 +1,99 @@ +import type { Reservation } from '../../../types'; +import type { DelayTone } from '../../../utils/flightLiveModel'; +import { useCurrentFlightLegIndex, useFlightLiveCard } from './useFlightLiveCard'; + +const DELAY_TEXT: Record = { ok: 'text-success', minor: 'text-warning', major: 'text-danger' }; + +/** The status dot: pulsing accent while the aircraft moves, green once landed, faint otherwise. */ +function Dot({ live, landed, size }: { live: boolean; landed: boolean; size: string }) { + return ( + + {live && } + + + ); +} + +interface FlightLiveStripProps { + tripId: number; + reservationId: number; + className?: string; +} + +/** + * A flight's live state on the booking cards: what is happening in one line + * with the delay, and a thin bar across the card while it flies. The full + * picture is one click away in the booking dialog. Nothing far ahead of the + * flight (the card shows its date already), nothing once it is long over. + */ +export default function FlightLiveStrip({ tripId, reservationId, className = '' }: FlightLiveStripProps) { + const legIndex = useCurrentFlightLegIndex(tripId, reservationId); + if (legIndex == null) return null; + return ; +} + +function Strip({ tripId, reservationId, legIndex, className }: FlightLiveStripProps & { legIndex: number }) { + const card = useFlightLiveCard(tripId, reservationId, legIndex); + if (!card || card.view.stage === 'past' || card.view.stage === 'upcoming') return null; + const { view } = card; + return ( +
+
+ + {card.line} + {card.delay && card.delay.tone !== 'ok' && ( + + {card.delay.text} + + )} +
+ {view.stage === 'airborne' && ( +
+ ); +} + +/** + * A third line under a flight's row in the desktop day plan while something is + * happening: the moment, a pulsing dot and the delay. Quiet days (departure + * more than three hours away, long over) add nothing, and so does any booking + * that is not a flight, so the plan can hand every transport row in. + */ +export function PlanFlightLiveLine({ + tripId, + res, +}: { + tripId: number; + res: Reservation & { __leg?: { index: number } }; +}) { + if (res.type !== 'flight') return null; + return ; +} + +function PlanLine({ tripId, reservationId, legIndex }: { tripId: number; reservationId: number; legIndex: number }) { + const card = useFlightLiveCard(tripId, reservationId, legIndex); + const stage = card?.view.stage; + if (!card || stage === 'past' || stage === 'upcoming') return null; + return ( +
+ + + {card.line} + + {card.delay && card.delay.tone !== 'ok' && ( + {card.delay.text} + )} +
+ ); +} diff --git a/client/src/components/Planner/flightLive/useFlightLiveCard.ts b/client/src/components/Planner/flightLive/useFlightLiveCard.ts new file mode 100644 index 000000000..79ffc434a --- /dev/null +++ b/client/src/components/Planner/flightLive/useFlightLiveCard.ts @@ -0,0 +1,228 @@ +import type { FlightLiveLeg } from '@trek/shared'; +import { useEffect, useState } from 'react'; +import { useTranslation } from '../../../i18n'; +import { useFlightLiveAttribution, useFlightLiveLeg, useFlightLiveLegs } from '../../../store/flightLiveStore'; +import { useSettingsStore } from '../../../store/settingsStore'; +import { + airportTime, + currentLeg, + delayTone, + flightLiveView, + splitDuration, + type DelayTone, + type FlightLiveView, +} from '../../../utils/flightLiveModel'; + +type T = ReturnType['t']; + +export interface FlightTimeCell { + /** The time that counts now: observed, estimated or planned. */ + value: string; + /** The planned time, only when it differs from `value`. */ + planned: string | null; + /** Shown under the time: "estimated", "actual" or nothing. */ + note: string | null; +} + +interface FlightStat { + label: string; + value: string; +} + +interface FlightLiveCard { + leg: FlightLiveLeg; + view: FlightLiveView; + /** The big line: "Departs in 2 h 10 min", "In the air", "Landed". */ + headline: string; + /** The quieter line under it, or null. */ + detail: string | null; + /** Both in one line for the strips and plan rows, in the language's own joining. */ + line: string; + delay: { text: string; tone: DelayTone } | null; + dep: FlightTimeCell; + arr: FlightTimeCell; + stats: FlightStat[]; + /** "Updated 2 min ago" with the feed's credit, or null before any data. */ + footnote: string | null; + attribution: string | null; + /** Around boarding, where a traveller looks for a gate open data does not have. */ + gateHint: boolean; + /** True while the aircraft is moving, for the pulsing status dot. */ + live: boolean; +} + +/** The current time, ticking every `ms` while mounted, for countdowns that move. */ +function useNow(ms: number): number { + const [now, setNow] = useState(() => Date.now()); + useEffect(() => { + const id = window.setInterval(() => setNow(Date.now()), ms); + return () => window.clearInterval(id); + }, [ms]); + return now; +} + +function durationText(ms: number, t: T): string { + const { days, hours, minutes } = splitDuration(ms); + if (days > 0) return t('flightLive.durDaysHours', { d: days, h: hours }); + if (hours > 0) return t('flightLive.durHoursMinutes', { h: hours, m: minutes }); + return t('flightLive.durMinutes', { m: Math.max(1, minutes) }); +} + +function delayText(minutes: number | null, t: T): { text: string; tone: DelayTone } | null { + if (minutes == null) return null; + if (minutes > 5) return { text: t('flightLive.late', { m: minutes }), tone: delayTone(minutes) }; + if (minutes < -5) return { text: t('flightLive.early', { m: -minutes }), tone: 'ok' }; + return { text: t('flightLive.onTime'), tone: 'ok' }; +} + +function headlineOf( + view: FlightLiveView, + leg: FlightLiveLeg, + t: T, + time: (ms: number, tz: string | null) => string +): { headline: string; detail: string | null } { + switch (view.stage) { + case 'upcoming': + case 'soon': + return { + headline: + view.countdownMs != null + ? t('flightLive.departsIn', { time: durationText(view.countdownMs, t) }) + : t('flightLive.scheduled'), + detail: view.stage === 'soon' ? t('flightLive.watching') : null, + }; + case 'taxiing': + return { headline: t('flightLive.taxiing'), detail: t('flightLive.atAirport', { code: leg.origin.code }) }; + case 'airborne': + return { + headline: t('flightLive.airborne'), + detail: view.countdownMs != null ? t('flightLive.landsIn', { time: durationText(view.countdownMs, t) }) : null, + }; + case 'landed': + return { + headline: t('flightLive.landed'), + detail: + view.arrExpected != null + ? t('flightLive.landedAt', { + time: time(view.arrExpected, leg.destination.timezone), + code: leg.destination.code, + }) + : null, + }; + case 'past': + return { headline: t('flightLive.over'), detail: null }; + case 'unknown': + return { headline: t('flightLive.noSignal'), detail: t('flightLive.noSignalHint') }; + } +} + +function timeCell( + actual: number | null, + planned: number | null, + tz: string | null, + estimate: boolean, + time: (ms: number, tz: string | null) => string, + t: T +): FlightTimeCell { + const shown = actual ?? planned; + if (shown == null) return { value: '--:--', planned: null, note: null }; + const value = time(shown, tz); + const plannedText = planned != null ? time(planned, tz) : null; + return { + value, + planned: actual != null && plannedText !== value ? plannedText : null, + note: actual == null ? null : estimate ? t('flightLive.estimated') : t('flightLive.actual'), + }; +} + +/** Altitude, speed and distance in the user's units while in the air, and the aircraft when known. */ +function statsOf(leg: FlightLiveLeg, view: FlightLiveView, imperial: boolean, locale: string, t: T): FlightStat[] { + const stats: FlightStat[] = []; + const pos = view.stage === 'airborne' ? leg.position : null; + const n = (value: number) => Math.round(value).toLocaleString(locale); + if (pos?.altitude_ft != null) { + const value = imperial + ? t('flightLive.feet', { n: n(pos.altitude_ft) }) + : t('flightLive.meters', { n: n(pos.altitude_ft * 0.3048) }); + stats.push({ label: t('flightLive.altitude'), value }); + } + if (pos?.ground_speed_kt != null) { + const value = imperial + ? t('flightLive.mph', { n: n(pos.ground_speed_kt * 1.15078) }) + : t('flightLive.kmh', { n: n(pos.ground_speed_kt * 1.852) }); + stats.push({ label: t('flightLive.speed'), value }); + } + if (view.stage === 'airborne' && leg.distance_remaining_km != null) { + const km = leg.distance_remaining_km; + stats.push({ + label: t('flightLive.remaining'), + value: imperial ? t('flightLive.mi', { n: n(km / 1.609344) }) : t('flightLive.km', { n: n(km) }), + }); + } + const aircraft = [leg.aircraft?.type, leg.aircraft?.registration].filter(Boolean).join(' '); + if (aircraft) stats.push({ label: t('flightLive.aircraft'), value: aircraft }); + return stats; +} + +/** "Updated 2 min ago", or the age of the last signal once it is stale; null before the feed ever heard it. */ +function footnoteOf(leg: FlightLiveLeg, view: FlightLiveView, now: number, t: T): string | null { + if (!leg.last_seen_at) return null; + const age = now - Date.parse(leg.last_seen_at); + return view.stale + ? t('flightLive.lastSignal', { time: durationText(age, t) }) + : t('flightLive.updated', { time: durationText(Math.max(60_000, age), t) }); +} + +/** In the air and on the ground the arrival delay counts, before take-off the departure delay. */ +function delayOf(view: FlightLiveView, t: T): { text: string; tone: DelayTone } | null { + if (view.stage === 'past' || view.stage === 'unknown') return null; + const flying = view.stage === 'airborne' || view.stage === 'landed'; + return delayText(flying ? (view.arrDelay ?? view.depDelay) : view.depDelay, t); +} + +/** + * Everything a live flight card shows for one leg, or null while TREK has no + * state for it (the feature switched off, an airline it cannot map, a server + * without the feature). Desktop and phone call this and only lay it out. + */ +export function useFlightLiveCard(tripId: number, reservationId: number, legIndex: number): FlightLiveCard | null { + const { t, locale } = useTranslation(); + const timeFormat = useSettingsStore((s) => s.settings.time_format) || '24h'; + const imperial = useSettingsStore((s) => s.settings.distance_unit) === 'imperial'; + const leg = useFlightLiveLeg(tripId, reservationId, legIndex); + const attribution = useFlightLiveAttribution(tripId); + // A second-level countdown is noise; the minute tick is what a traveller reads. + const now = useNow(30_000); + if (!leg) return null; + + const view = flightLiveView(leg, now); + const time = (ms: number, tz: string | null) => airportTime(ms, tz, locale, timeFormat); + const { headline, detail } = headlineOf(view, leg, t, time); + const footnote = footnoteOf(leg, view, now, t); + return { + leg, + view, + headline, + detail, + line: detail && view.stage === 'airborne' ? t('flightLive.headlineDetail', { headline, detail }) : headline, + delay: delayOf(view, t), + dep: timeCell(view.depActual, view.depPlanned, leg.origin.timezone, false, time, t), + arr: timeCell(view.arrExpected, view.arrPlanned, leg.destination.timezone, view.arrIsEstimate, time, t), + stats: statsOf(leg, view, imperial, locale, t), + footnote, + // The feed is credited only for data it gave. + attribution: footnote ? attribution : null, + gateHint: view.stage === 'soon' || view.stage === 'taxiing', + live: view.stage === 'airborne' || view.stage === 'taxiing', + }; +} + +/** + * The leg a one-line summary of a booking speaks for (see currentLeg), as a + * leg index, or null while TREK follows none of its legs. + */ +export function useCurrentFlightLegIndex(tripId: number, reservationId: number): number | null { + const legs = useFlightLiveLegs(tripId, reservationId); + const now = useNow(60_000); + return currentLeg(legs, now)?.leg_index ?? null; +} diff --git a/client/src/components/Planner/flightLive/useFlightLiveSync.ts b/client/src/components/Planner/flightLive/useFlightLiveSync.ts new file mode 100644 index 000000000..46a127e26 --- /dev/null +++ b/client/src/components/Planner/flightLive/useFlightLiveSync.ts @@ -0,0 +1,60 @@ +import { useEffect } from 'react'; +import { useFlightLiveStore, watchFlightLive } from '../../../store/flightLiveStore'; +import { toMs } from '../../../utils/flightLiveModel'; + +const ACTIVE_MS = 60_000; +const IDLE_MS = 10 * 60_000; +const BEFORE_MS = 3 * 60 * 60_000; +const AFTER_MS = 2 * 60 * 60_000; + +/** True while one of the trip's legs is inside its watch window, where minutes matter. */ +function anyActive(tripId: number, now: number): boolean { + const legs = Object.values(useFlightLiveStore.getState().trips[tripId]?.legs ?? {}); + return legs.some((leg) => { + const dep = toMs(leg.departed_at) ?? toMs(leg.scheduled_departure); + const arr = toMs(leg.landed_at) ?? toMs(leg.estimated_arrival) ?? toMs(leg.scheduled_arrival); + return dep != null && arr != null && now >= dep - BEFORE_MS && now <= arr + AFTER_MS && leg.phase !== 'landed'; + }); +} + +/** + * Keeps the open trip's live flight states current: one read when the trip has + * flights, the server's `flight:live` pushes in between, and a quiet re-read + * (every minute while a flight is near, every ten otherwise) as the safety net + * for a missed push. Nothing runs while the tab is hidden; coming back reads + * once. Mounted once per open trip by the planner, on desktop and phone alike. + */ +export function useFlightLiveSync(tripId: number, hasFlights: boolean): void { + useEffect(() => { + if (!hasFlights || !Number.isFinite(tripId)) return; + const load = () => void useFlightLiveStore.getState().load(tripId); + load(); + const stopWatching = watchFlightLive(tripId); + + let timer = 0; + const schedule = () => { + window.clearTimeout(timer); + timer = window.setTimeout( + () => { + if (!document.hidden) load(); + schedule(); + }, + anyActive(tripId, Date.now()) ? ACTIVE_MS : IDLE_MS + ); + }; + schedule(); + const onVisible = () => { + if (!document.hidden) { + load(); + schedule(); + } + }; + document.addEventListener('visibilitychange', onVisible); + + return () => { + window.clearTimeout(timer); + stopWatching(); + document.removeEventListener('visibilitychange', onVisible); + }; + }, [tripId, hasFlights]); +} diff --git a/client/src/components/Settings/notificationLabels.ts b/client/src/components/Settings/notificationLabels.ts index 367ad4ee1..4ee220653 100644 --- a/client/src/components/Settings/notificationLabels.ts +++ b/client/src/components/Settings/notificationLabels.ts @@ -29,6 +29,9 @@ export const EVENT_LABEL_KEYS: Record = { packing_tagged: 'settings.notifyPackingTagged', wanderer_source_hint: 'settings.notifyWandererSourceHint', version_available: 'settings.notifyVersionAvailable', + flight_departed: 'settings.notifyFlightDeparted', + flight_delayed: 'settings.notifyFlightDelayed', + flight_landed: 'settings.notifyFlightLanded', } /** Plugin channels have no i18n; the server sends their display name outright. */ diff --git a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx index 9d3302c1a..fe5fc25e3 100644 --- a/client/src/mobile/screens/admin/MAdminSettingsSection.tsx +++ b/client/src/mobile/screens/admin/MAdminSettingsSection.tsx @@ -34,6 +34,7 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio placeShadowEnabled, passwordLogin, setPasswordLogin, passwordRegistration, setPasswordRegistration, oidcLogin, setOidcLogin, oidcRegistration, setOidcRegistration, oidcAutoRedirect, setOidcAutoRedirect, + flightLive, setFlightLive, flightLiveLocked, envOverrideOidcOnly, oidcConfigured, requireMfa, passkeyLogin, setPasskeyLogin, passkeyConfigured, webauthnRpId, setWebauthnRpId, webauthnOrigins, setWebauthnOrigins, savingWebauthn, handleSaveWebauthn, @@ -186,6 +187,26 @@ export default function MAdminSettingsSection({ admin, t }: MAdminSettingsSectio /> + {/* Live flight status: open ADS-B data, no key, on by default (desktop parity). */} + + + void handleToggleAuthSetting('flight_live_enabled', v, setFlightLive)} + /> + } + /> + + {/* Allowed file types */} diff --git a/client/src/mobile/screens/trip/MFlightLiveStrip.tsx b/client/src/mobile/screens/trip/MFlightLiveStrip.tsx new file mode 100644 index 000000000..19689f35f --- /dev/null +++ b/client/src/mobile/screens/trip/MFlightLiveStrip.tsx @@ -0,0 +1,119 @@ +import { useCurrentFlightLegIndex, useFlightLiveCard } from '../../../components/Planner/flightLive/useFlightLiveCard'; +import type { DelayTone } from '../../../utils/flightLiveModel'; + +const DELAY_COLOR: Record = { + ok: 'var(--m-st-confirmed)', + minor: 'var(--m-st-pending)', + major: 'var(--m-st-danger)', +}; + +const LIVE = 'var(--m-st-info)'; + +/** The status dot: pulsing blue while the aircraft moves, green once landed, faint otherwise. */ +function Dot({ live, landed, size }: { live: boolean; landed: boolean; size: string }) { + return ( + + {live && ( + + )} + + + ); +} + +interface MFlightLiveStripProps { + tripId: number; + reservationId: number; + /** Opens the transport sheet, where the full live card sits. */ + onOpen: () => void; + className?: string; +} + +/** + * A flight's live state on the phone's transport cards: what is happening in + * one line with the delay, and a thin bar across the card while it flies. A + * tap opens the transport sheet with the full card. Nothing far ahead of the + * flight (the card shows its date already), nothing once it is long over. + */ +export default function MFlightLiveStrip({ tripId, reservationId, onOpen, className = '' }: MFlightLiveStripProps) { + const legIndex = useCurrentFlightLegIndex(tripId, reservationId); + if (legIndex == null) return null; + return ( + + ); +} + +function Strip({ tripId, reservationId, legIndex, onOpen, className }: MFlightLiveStripProps & { legIndex: number }) { + const card = useFlightLiveCard(tripId, reservationId, legIndex); + if (!card || card.view.stage === 'past' || card.view.stage === 'upcoming') return null; + const { view } = card; + return ( + + ); +} + +/** + * A flight's moment under its row in the phone's day plan while something is + * happening ("In the air, lands in 1 h 5 min") with a pulsing dot and the + * delay; below the route, like the desktop's third line. Nothing on quiet days. + */ +export function MPlanFlightLine({ + tripId, + reservationId, + legIndex, +}: { + tripId: number; + reservationId: number; + legIndex: number; +}) { + const card = useFlightLiveCard(tripId, reservationId, legIndex); + const stage = card?.view.stage; + if (!card || stage === 'past' || stage === 'upcoming') return null; + return ( +
+ + + {card.line} + + {card.delay && card.delay.tone !== 'ok' && ( + + {card.delay.text} + + )} +
+ ); +} diff --git a/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx b/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx index 6af04ac27..f7b8aeed5 100644 --- a/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx +++ b/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx @@ -24,6 +24,8 @@ import { TourDayTimeText, TourOverrunLine } from '../../../../components/Tours/T import { tourDayEntryOf, type TourOverrun } from '../../../../components/Tours/tourDayTime' import type { WalkLate } from '../../../../components/Tours/walk/walkTransit' import { flowText } from '../../../../utils/flowText' +import { useTripStore } from '../../../../store/tripStore' +import { MPlanFlightLine } from '../MFlightLiveStrip' /** * The five row types of the mobile day timeline (place / manual transport / @@ -267,6 +269,7 @@ export function TransportRow({ res, dayId, chrome, reorder, drag, onOpen }: { ? `${fmtTime(start, chrome)}${phase === 'single' && end ? ` – ${fmtTime(end, chrome)}` : ''}` : '' const sub = transportSubtitle(res, chrome.t) + const tripId = useTripStore(st => st.trip?.id) return (
{time}}
{sub &&
{sub}
} + {res.type === 'flight' && tripId != null && }
diff --git a/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx b/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx new file mode 100644 index 000000000..03e86a6eb --- /dev/null +++ b/client/src/mobile/screens/trip/sheets/MFlightLiveCard.tsx @@ -0,0 +1,150 @@ +import { Info, Radio } from 'lucide-react'; +import FlightArc from '../../../../components/Planner/flightLive/FlightArc'; +import { useFlightLiveCard, type FlightTimeCell } from '../../../../components/Planner/flightLive/useFlightLiveCard'; +import { useTranslation } from '../../../../i18n'; +import type { DelayTone } from '../../../../utils/flightLiveModel'; +import { INNER_CLS, StatBox } from './MTripSheetUi'; + +const DELAY_CHIP: Record = { + ok: 'bg-[color-mix(in_srgb,var(--m-st-confirmed)_16%,transparent)] text-[color:var(--m-st-confirmed)]', + minor: 'bg-[color-mix(in_srgb,var(--m-st-pending)_18%,transparent)] text-[color:var(--m-st-pending)]', + major: 'bg-[color-mix(in_srgb,var(--m-st-danger)_16%,transparent)] text-[color:var(--m-st-danger)]', +}; + +const LIVE = 'var(--m-st-info)'; + +function Airport({ + code, + city, + cell, + end, +}: { + code: string; + city: string | null; + cell: FlightTimeCell; + end?: boolean; +}) { + return ( +
+ {code} + {city && ( + + {city} + + )} + {cell.planned && {cell.planned}} + + {cell.value} + + {cell.note && ( + {cell.note} + )} +
+ ); +} + +interface MFlightLiveCardProps { + tripId: number; + reservationId: number; + legIndex: number; + legLabel?: string; +} + +/** + * The live flight card of the phone's transport sheet: the moment in one line, + * the two airports large with their times, the route as an arc with the + * aircraft on it, and the numbers of the moment as the sheet's own stat boxes. + * Same data as the desktop card (useFlightLiveCard), laid out for a thumb. + */ +export default function MFlightLiveCard({ tripId, reservationId, legIndex, legLabel }: MFlightLiveCardProps) { + const { t } = useTranslation(); + const card = useFlightLiveCard(tripId, reservationId, legIndex); + if (!card) return null; + const { leg, view } = card; + const quiet = view.stage === 'past' || view.stage === 'unknown'; + + return ( +
+ {legLabel && ( +
+ {legLabel} +
+ )} +
+ + {card.live && ( + + )} + + +
+
{card.headline}
+ {card.detail &&
{card.detail}
} +
+ {card.delay && ( + + {card.delay.text} + + )} +
+ +
+ +
+ + + {leg.flight_number} + +
+ +
+ + {card.stats.length > 0 && ( +
+ {card.stats.map((s) => ( + + ))} +
+ )} + + {card.gateHint && ( +

+ + {t('flightLive.noGateHint')} +

+ )} + + {card.footnote && ( +
+ + + {card.footnote} + + {card.attribution && {card.attribution}} +
+ )} +
+ ); +} diff --git a/client/src/mobile/screens/trip/sheets/MTransportSheet.tsx b/client/src/mobile/screens/trip/sheets/MTransportSheet.tsx index 631114780..e726d2b03 100644 --- a/client/src/mobile/screens/trip/sheets/MTransportSheet.tsx +++ b/client/src/mobile/screens/trip/sheets/MTransportSheet.tsx @@ -21,6 +21,8 @@ import { ActionCircle, Eyebrow, INNER_CLS, StatBox, TileHeader, displayTime } fr import { CardFiles } from '../tabs/MReservationCardParts' import { downloadAttachment, openAttachment } from '../../../../components/Planner/bookings/openAttachment' import { flowText } from '../../../../utils/flowText' +import { useFlightLiveLegs } from '../../../../store/flightLiveStore' +import MFlightLiveCard from './MFlightLiveCard' interface TransportSheetPayload { reservationId?: number @@ -108,6 +110,7 @@ export default function MTransportSheet({ planner, shell }: MTripSheetsProps) { const timeFormat = useSettingsStore(s => s.settings.time_format) || '24h' const blurCodes = useSettingsStore(s => s.settings.blur_booking_codes) const [codeRevealed, setCodeRevealed] = useState(false) + const liveLegs = useFlightLiveLegs(planner.tripId, payload.reservationId ?? -1) useEffect(() => { if (!open) setCodeRevealed(false) }, [open]) // Hold the last reservation so the card content survives the exit animation. @@ -163,6 +166,9 @@ export default function MTransportSheet({ planner, shell }: MTripSheetsProps) { const platform = leg && !isFlight ? legDetail.platform : meta.platform const transitLegs: TransitLeg[] = Array.isArray(meta.transit?.legs) ? meta.transit.legs : [] + // Opened from one leg's row, only that leg's live card; from the booking, every followed leg. + const shownLive = leg ? liveLegs.filter(l => l.leg_index === payload.legIndex) : liveLegs + const resFiles = filesFor(res, planner.files || []) const confirmed = res.status === 'confirmed' @@ -232,13 +238,24 @@ export default function MTransportSheet({ planner, shell }: MTripSheetsProps) { )} - {/* ── Times / seat stats ── */} - {hotelStats.length === 0 && (depTime || arrTime || seat || platform) && ( + {/* ── Live flight: the leg opened from, or every followed leg of the booking ── */} + {shownLive.map(l => ( + 1 ? t('flightLive.legOf', { n: l.leg_index + 1, total: routeLegs.length }) : undefined} + /> + ))} + + {/* ── Times / seat stats (the live card already shows the times) ── */} + {hotelStats.length === 0 && ((shownLive.length === 0 && (depTime || arrTime)) || seat || platform) && (
- {depTime && ( + {shownLive.length === 0 && depTime && ( )} - {arrTime && ( + {shownLive.length === 0 && arrTime && ( )} {platform && } diff --git a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx index ccbd63e00..4b4d78038 100644 --- a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx +++ b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx @@ -12,6 +12,7 @@ import { useReservationListFilter } from '../../../../components/Planner/booking import { useReservationCard } from '../../../../components/Planner/bookings/useReservationCard' import { orderedEndpoints } from '../../../../utils/flightLegs' import { filesFor } from '../../../../utils/reservationFiles' +import MFlightLiveStrip from '../MFlightLiveStrip' /** * Tab 1 — Transporte. Real `planner.reservations` filtered to the 10 transport @@ -155,6 +156,11 @@ function TransportCard({ res, planner, shell, canEdit, compact }: { {canEdit && }
+ {/* A flight TREK follows live: its moment in one line, on the compact card too. */} + {res.type === 'flight' && ( + + )} + {/* Body — split around the booking code so the reveal can be its own control instead of a click handler buried inside the card button. */} {!compact && ( diff --git a/client/src/pages/admin/AdminSettingsTab.tsx b/client/src/pages/admin/AdminSettingsTab.tsx index 0f801d6dc..812ab3e82 100644 --- a/client/src/pages/admin/AdminSettingsTab.tsx +++ b/client/src/pages/admin/AdminSettingsTab.tsx @@ -3,7 +3,7 @@ import { adminApi } from '../../api/client' import { getApiErrorMessage } from '../../types' import { AlertTriangle, CheckCircle, Compass, Eye, EyeOff, FileType, Fingerprint, KeyRound, Loader2, LockKeyhole, LogIn, - RefreshCw, Save, ShieldCheck, XCircle, + Plane, RefreshCw, Save, ShieldCheck, XCircle, } from 'lucide-react' import ToggleSwitch from '../../components/Settings/ToggleSwitch' import CustomSelect from '../../components/shared/CustomSelect' @@ -122,6 +122,7 @@ export default function AdminSettingsTab({ admin, t }: AdminSettingsTabProps): R oidcConfig, setOidcConfig, savingOidc, passwordLogin, setPasswordLogin, passwordRegistration, setPasswordRegistration, oidcLogin, setOidcLogin, oidcRegistration, setOidcRegistration, oidcAutoRedirect, setOidcAutoRedirect, + flightLive, setFlightLive, flightLiveLocked, envOverrideOidcOnly, oidcConfigured, requireMfa, passkeyLogin, setPasskeyLogin, passkeyConfigured, webauthnRpId, setWebauthnRpId, webauthnOrigins, setWebauthnOrigins, savingWebauthn, handleSaveWebauthn, @@ -398,6 +399,7 @@ export default function AdminSettingsTab({ admin, t }: AdminSettingsTabProps): R sharing place details is still the admin's decision. */} {managed && } + {/* Place search and routing: TREK's own services first, then which provider answers search and transit, and the search log. Apart from the keys, so a keyless install reads its whole setup in one card. Everything here saves @@ -515,6 +517,24 @@ export default function AdminSettingsTab({ admin, t }: AdminSettingsTabProps): R )} + {/* Live flight status: open ADS-B data, no key, on by default; the admin may keep it off. */} + + + void handleToggleAuthSetting('flight_live_enabled', !flightLive, setFlightLive)} + /> + } + /> + + + {/* API Keys: only the keyed providers, Google, Unsplash and Amap. They are the operator's on a managed install, so the card is not shown there (server managed.ts), and neither is the provider pick in the card diff --git a/client/src/pages/admin/useAdmin.ts b/client/src/pages/admin/useAdmin.ts index f1791073f..9c5ced821 100644 --- a/client/src/pages/admin/useAdmin.ts +++ b/client/src/pages/admin/useAdmin.ts @@ -146,6 +146,10 @@ export function useAdmin() { const [oidcLogin, setOidcLogin] = useState(true) const [oidcRegistration, setOidcRegistration] = useState(true) const [oidcAutoRedirect, setOidcAutoRedirect] = useState(true) + // Live flight status (flight_live_enabled): on until an admin stores 'false'; the server leaves a never-set key out. + const [flightLive, setFlightLive] = useState(true) + // FLIGHT_LIVE_ENABLED set on the server holds the switch; the form shows its value, locked. + const [flightLiveLocked, setFlightLiveLocked] = useState(false) const [envOverrideOidcOnly, setEnvOverrideOidcOnly] = useState(false) const [oidcConfigured, setOidcConfigured] = useState(false) const [requireMfa, setRequireMfa] = useState(false) @@ -177,6 +181,8 @@ export function useAdmin() { setSmtpValues(r.data || {}) if (r.data?.webauthn_rp_id) setWebauthnRpId(r.data.webauthn_rp_id) if (r.data?.webauthn_origins) setWebauthnOrigins(r.data.webauthn_origins) + setFlightLive(String(r.data?.flight_live_enabled ?? 'true') !== 'false') + setFlightLiveLocked(r.data?.env_override_flight_live_enabled != null) setSmtpLoaded(true) }).catch(() => setSmtpLoaded(true)) }, []) @@ -603,6 +609,7 @@ export function useAdmin() { oidcConfig, setOidcConfig, savingOidc, setSavingOidc, passwordLogin, setPasswordLogin, passwordRegistration, setPasswordRegistration, oidcLogin, setOidcLogin, oidcRegistration, setOidcRegistration, oidcAutoRedirect, setOidcAutoRedirect, + flightLive, setFlightLive, flightLiveLocked, envOverrideOidcOnly, setEnvOverrideOidcOnly, oidcConfigured, setOidcConfigured, requireMfa, setRequireMfa, passkeyLogin, setPasskeyLogin, passkeyConfigured, diff --git a/client/src/pages/tripPlanner/useTripPlanner.ts b/client/src/pages/tripPlanner/useTripPlanner.ts index deb8163d8..86501b9fa 100644 --- a/client/src/pages/tripPlanner/useTripPlanner.ts +++ b/client/src/pages/tripPlanner/useTripPlanner.ts @@ -69,6 +69,7 @@ import { useIsPhone } from '../../mobile/useIsPhone' import { useIsWide } from '../../hooks/sizeClass' import { useRoadtripVias } from '../../components/Roadtrip/useRoadtripVias' import { TRIP_SPLASH_AFTER_MS } from '../../components/shared/useTripSplashBeats' +import { useFlightLiveSync } from '../../components/Planner/flightLive/useFlightLiveSync' /** * The trip's roster from the server: the owner and the members. Null offline @@ -120,6 +121,8 @@ export function useTripPlanner() { const todoItems = useTripStore(s => s.todoItems) const categories = useTripStore(s => s.categories) const reservations = useTripStore(s => s.reservations) + // Live flight states (status, position, delay) for the trip's flights, desktop and phone alike. + useFlightLiveSync(tripId, reservations.some(r => r.type === 'flight')) const budgetItems = useTripStore(s => s.budgetItems) const files = useTripStore(s => s.files) const selectedDayId = useTripStore(s => s.selectedDayId) diff --git a/client/src/store/flightLiveStore.test.ts b/client/src/store/flightLiveStore.test.ts new file mode 100644 index 000000000..002039806 --- /dev/null +++ b/client/src/store/flightLiveStore.test.ts @@ -0,0 +1,118 @@ +// FE-STORE-FLIGHTLIVE-001 to FE-STORE-FLIGHTLIVE-007 +import type { FlightLiveLeg } from '@trek/shared'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + +const listeners = new Set<(event: Record) => void>(); + +vi.mock('../api/flightLive', () => ({ flightLiveApi: { trip: vi.fn() } })); +vi.mock('../api/websocket', () => ({ + addListener: (fn: (event: Record) => void) => listeners.add(fn), + removeListener: (fn: (event: Record) => void) => listeners.delete(fn), +})); +vi.mock('../sync/networkMode', () => ({ isEffectivelyOffline: vi.fn(() => false) })); + +import { flightLiveApi } from '../api/flightLive'; +import { isEffectivelyOffline } from '../sync/networkMode'; +import { legKey, useFlightLiveStore, watchFlightLive } from './flightLiveStore'; + +function leg(over: Partial = {}): FlightLiveLeg { + return { + reservation_id: 6, + leg_index: 0, + callsign: 'DLH400', + flight_number: 'LH 400', + service_date: '2026-06-11', + origin: { code: 'FRA', name: 'Frankfurt', lat: 50.03, lng: 8.57, timezone: 'Europe/Berlin' }, + destination: { code: 'JFK', name: 'New York JFK', lat: 40.64, lng: -73.78, timezone: 'America/New_York' }, + phase: 'scheduled', + scheduled_departure: '2026-06-11T11:50:00.000Z', + scheduled_arrival: '2026-06-11T20:35:00.000Z', + departed_at: null, + landed_at: null, + estimated_arrival: null, + departure_delay_min: null, + arrival_delay_min: null, + progress: null, + distance_total_km: null, + distance_remaining_km: null, + position: null, + aircraft: null, + last_seen_at: null, + fetched_at: null, + stale: false, + source: null, + ...over, + }; +} + +beforeEach(() => { + useFlightLiveStore.setState({ trips: {} }); + listeners.clear(); + vi.mocked(flightLiveApi.trip).mockReset(); + vi.mocked(isEffectivelyOffline).mockReturnValue(false); +}); + +describe('flightLiveStore', () => { + it('FE-STORE-FLIGHTLIVE-001: keeps a valid answer by leg', async () => { + vi.mocked(flightLiveApi.trip).mockResolvedValue({ enabled: true, attribution: 'adsb.lol', flights: [leg()] }); + await useFlightLiveStore.getState().load(1); + const trip = useFlightLiveStore.getState().trips[1]; + expect(trip.attribution).toBe('adsb.lol'); + expect(trip.legs[legKey(6, 0)].callsign).toBe('DLH400'); + }); + + it('FE-STORE-FLIGHTLIVE-002: ignores a malformed answer and a failed request', async () => { + vi.mocked(flightLiveApi.trip).mockResolvedValueOnce({ nope: true }); + await useFlightLiveStore.getState().load(1); + vi.mocked(flightLiveApi.trip).mockRejectedValueOnce(new Error('down')); + await useFlightLiveStore.getState().load(1); + expect(useFlightLiveStore.getState().trips[1]).toBeUndefined(); + }); + + it('FE-STORE-FLIGHTLIVE-003: asks nothing offline', async () => { + vi.mocked(isEffectivelyOffline).mockReturnValue(true); + await useFlightLiveStore.getState().load(1); + expect(flightLiveApi.trip).not.toHaveBeenCalled(); + }); + + it('FE-STORE-FLIGHTLIVE-004: merges a push for its trip only', async () => { + vi.mocked(flightLiveApi.trip).mockResolvedValue({ enabled: true, attribution: null, flights: [leg()] }); + await useFlightLiveStore.getState().load(1); + const stop = watchFlightLive(1); + for (const fn of listeners) fn({ type: 'flight:live', tripId: 2, flights: [leg({ phase: 'airborne' })] }); + expect(useFlightLiveStore.getState().trips[1].legs[legKey(6, 0)].phase).toBe('scheduled'); + for (const fn of listeners) + fn({ type: 'flight:live', tripId: 1, flights: [leg({ phase: 'airborne' }), { broken: true }] }); + expect(useFlightLiveStore.getState().trips[1].legs[legKey(6, 0)].phase).toBe('airborne'); + stop(); + expect(listeners.size).toBe(0); + }); + + it('FE-STORE-FLIGHTLIVE-005: a push for a trip never loaded is dropped', () => { + useFlightLiveStore.getState().merge(3, [leg()]); + expect(useFlightLiveStore.getState().trips[3]).toBeUndefined(); + }); + + it('FE-STORE-FLIGHTLIVE-006: an answer with the switch off keeps no legs', async () => { + vi.mocked(flightLiveApi.trip).mockResolvedValue({ enabled: false, attribution: null, flights: [] }); + await useFlightLiveStore.getState().load(1); + expect(useFlightLiveStore.getState().trips[1]).toEqual({ enabled: false, attribution: null, legs: {} }); + }); + + it('FE-STORE-FLIGHTLIVE-007: a read keeps a push that arrived while it was under way', async () => { + vi.mocked(flightLiveApi.trip).mockResolvedValue({ + enabled: true, + attribution: null, + flights: [leg({ fetched_at: '2026-06-11T12:00:00.000Z' })], + }); + await useFlightLiveStore.getState().load(1); + useFlightLiveStore.getState().merge(1, [leg({ phase: 'airborne', fetched_at: '2026-06-11T12:05:00.000Z' })]); + vi.mocked(flightLiveApi.trip).mockResolvedValue({ + enabled: true, + attribution: null, + flights: [leg({ fetched_at: '2026-06-11T12:01:00.000Z' })], + }); + await useFlightLiveStore.getState().load(1); + expect(useFlightLiveStore.getState().trips[1].legs[legKey(6, 0)].phase).toBe('airborne'); + }); +}); diff --git a/client/src/store/flightLiveStore.ts b/client/src/store/flightLiveStore.ts new file mode 100644 index 000000000..aa5b5f9dc --- /dev/null +++ b/client/src/store/flightLiveStore.ts @@ -0,0 +1,107 @@ +import { flightLiveLegSchema, tripFlightLiveResponseSchema, type FlightLiveLeg } from '@trek/shared'; +import { create } from 'zustand'; +import { useShallow } from 'zustand/react/shallow'; +import { flightLiveApi } from '../api/flightLive'; +import { addListener, removeListener } from '../api/websocket'; +import { isEffectivelyOffline } from '../sync/networkMode'; + +/** + * Live flight states per trip (GET /trips/:id/flights/live plus the + * `flight:live` pushes). Kept apart from the trip store on purpose: it is + * transient feed data with no offline copy, so it never goes through the + * repo/Dexie layer, and an old state is worth nothing once the flight is over. + */ + +interface TripFlightLive { + enabled: boolean; + attribution: string | null; + /** By `legKey`. */ + legs: Record; +} + +interface FlightLiveState { + trips: Record; + load: (tripId: number) => Promise; + merge: (tripId: number, legs: FlightLiveLeg[]) => void; +} + +export const legKey = (reservationId: number, legIndex: number): string => `${reservationId}:${legIndex}`; + +const byKey = (legs: FlightLiveLeg[]): Record => + Object.fromEntries(legs.map((leg) => [legKey(leg.reservation_id, leg.leg_index), leg])); + +/** The incoming legs, except where the one already held was fetched later. */ +function newest(held: Record | undefined, incoming: Record) { + if (!held) return incoming; + const out: Record = {}; + for (const [key, leg] of Object.entries(incoming)) { + const mine = held[key]; + out[key] = mine && (mine.fetched_at ?? '') > (leg.fetched_at ?? '') ? mine : leg; + } + return out; +} + +export const useFlightLiveStore = create((set) => ({ + trips: {}, + + load: async (tripId) => { + if (!tripId || isEffectivelyOffline()) return; + try { + const parsed = tripFlightLiveResponseSchema.safeParse(await flightLiveApi.trip(tripId)); + // A server without the feature (older version) or a malformed answer leaves + // the cards on their schedule-only look rather than breaking the sheet. + if (!parsed.success) return; + const { enabled, attribution, flights } = parsed.data; + // A push that landed while this read was under way is newer than its answer and stays. + set((state) => ({ + trips: { + ...state.trips, + [tripId]: { enabled, attribution, legs: newest(state.trips[tripId]?.legs, byKey(flights)) }, + }, + })); + } catch { + // Offline or the feed is down: the last known state stays, marked stale by its age. + } + }, + + merge: (tripId, legs) => + set((state) => { + const current = state.trips[tripId]; + if (!current) return state; + return { trips: { ...state.trips, [tripId]: { ...current, legs: { ...current.legs, ...byKey(legs) } } } }; + }), +})); + +/** The live state of one leg, or null while there is none. */ +export function useFlightLiveLeg(tripId: number, reservationId: number, legIndex: number): FlightLiveLeg | null { + return useFlightLiveStore((s) => s.trips[tripId]?.legs[legKey(reservationId, legIndex)] ?? null); +} + +/** The live legs of one booking in leg order; empty while TREK follows none of them. */ +export function useFlightLiveLegs(tripId: number, reservationId: number): FlightLiveLeg[] { + return useFlightLiveStore( + useShallow((s) => + Object.values(s.trips[tripId]?.legs ?? {}) + .filter((leg) => leg.reservation_id === reservationId) + .sort((a, b) => a.leg_index - b.leg_index) + ) + ); +} + +export function useFlightLiveAttribution(tripId: number): string | null { + return useFlightLiveStore((s) => (s.trips[tripId]?.enabled ? s.trips[tripId].attribution : null)); +} + +/** Applies `flight:live` pushes for the given trip. Returns the function that stops listening. */ +export function watchFlightLive(tripId: number): () => void { + const onEvent = (event: Record) => { + if (event?.type !== 'flight:live' || Number(event.tripId) !== tripId || !Array.isArray(event.flights)) return; + const legs = event.flights.flatMap((raw) => { + const leg = flightLiveLegSchema.safeParse(raw); + return leg.success ? [leg.data] : []; + }); + if (legs.length > 0) useFlightLiveStore.getState().merge(tripId, legs); + }; + addListener(onEvent); + return () => removeListener(onEvent); +} diff --git a/client/src/utils/flightLiveModel.test.ts b/client/src/utils/flightLiveModel.test.ts new file mode 100644 index 000000000..6afe0d429 --- /dev/null +++ b/client/src/utils/flightLiveModel.test.ts @@ -0,0 +1,127 @@ +// FE-FLIGHTLIVE-MODEL-001 to FE-FLIGHTLIVE-MODEL-012 (011 retired with the great-circle helper) +import type { FlightLiveLeg } from '@trek/shared'; +import { describe, expect, it } from 'vitest'; + +import { airportTime, currentLeg, delayTone, flightLiveView, splitDuration, toMs } from './flightLiveModel'; + +const DEP = Date.parse('2026-06-11T11:50:00Z'); +const ARR = Date.parse('2026-06-11T20:35:00Z'); +const H = 3_600_000; + +function leg(over: Partial = {}): FlightLiveLeg { + return { + reservation_id: 6, + leg_index: 0, + callsign: 'DLH400', + flight_number: 'LH 400', + service_date: '2026-06-11', + origin: { code: 'FRA', name: 'Frankfurt', lat: 50.03, lng: 8.57, timezone: 'Europe/Berlin' }, + destination: { code: 'JFK', name: 'New York JFK', lat: 40.64, lng: -73.78, timezone: 'America/New_York' }, + phase: 'scheduled', + scheduled_departure: new Date(DEP).toISOString(), + scheduled_arrival: new Date(ARR).toISOString(), + departed_at: null, + landed_at: null, + estimated_arrival: null, + departure_delay_min: null, + arrival_delay_min: null, + progress: null, + distance_total_km: 6200, + distance_remaining_km: null, + position: null, + aircraft: null, + last_seen_at: null, + fetched_at: null, + stale: false, + source: null, + ...over, + }; +} + +describe('flightLiveView', () => { + it('FE-FLIGHTLIVE-MODEL-001: counts down to departure while it is more than three hours away', () => { + const view = flightLiveView(leg(), DEP - 5 * H); + expect(view.stage).toBe('upcoming'); + expect(view.countdownMs).toBe(5 * H); + expect(view.progress).toBe(0); + }); + + it('FE-FLIGHTLIVE-MODEL-002: turns to soon within three hours of departure', () => { + expect(flightLiveView(leg(), DEP - 2 * H).stage).toBe('soon'); + }); + + it('FE-FLIGHTLIVE-MODEL-003: reads progress, the estimate and the countdown to landing in the air', () => { + const view = flightLiveView( + leg({ + phase: 'airborne', + departed_at: new Date(DEP + 24 * 60_000).toISOString(), + estimated_arrival: new Date(ARR + 16 * 60_000).toISOString(), + progress: 0.42, + departure_delay_min: 24, + arrival_delay_min: 16, + }), + DEP + 3 * H + ); + expect(view.stage).toBe('airborne'); + expect(view.progress).toBe(0.42); + expect(view.arrExpected).toBe(ARR + 16 * 60_000); + expect(view.arrIsEstimate).toBe(true); + expect(view.countdownMs).toBe(ARR + 16 * 60_000 - (DEP + 3 * H)); + }); + + it('FE-FLIGHTLIVE-MODEL-004: places a stale aircraft by the clock when the feed gave no progress', () => { + const view = flightLiveView(leg({ phase: 'airborne', stale: true }), DEP + (ARR - DEP) / 2); + expect(view.progress).toBeCloseTo(0.5, 5); + expect(view.stale).toBe(true); + }); + + it('FE-FLIGHTLIVE-MODEL-005: a landed flight is full and its arrival is no longer an estimate', () => { + const view = flightLiveView(leg({ phase: 'landed', landed_at: new Date(ARR + 5 * 60_000).toISOString() }), ARR + H); + expect(view.stage).toBe('landed'); + expect(view.progress).toBe(1); + expect(view.arrIsEstimate).toBe(false); + expect(view.countdownMs).toBeNull(); + }); + + it('FE-FLIGHTLIVE-MODEL-006: a schedule long over without any sighting reads as past', () => { + expect(flightLiveView(leg(), ARR + 2 * H).stage).toBe('past'); + }); + + it('FE-FLIGHTLIVE-MODEL-007: passes unknown through, a callsign the feed never heard', () => { + expect(flightLiveView(leg({ phase: 'unknown' }), DEP + H).stage).toBe('unknown'); + }); +}); + +describe('helpers', () => { + it('FE-FLIGHTLIVE-MODEL-008: grades delays as on time, minor and major', () => { + expect(delayTone(null)).toBe('ok'); + expect(delayTone(5)).toBe('ok'); + expect(delayTone(12)).toBe('minor'); + expect(delayTone(30)).toBe('major'); + }); + + it('FE-FLIGHTLIVE-MODEL-009: rounds a duration up to the next minute and splits it', () => { + expect(splitDuration(61_000)).toEqual({ days: 0, hours: 0, minutes: 2 }); + expect(splitDuration(26 * H + 5 * 60_000)).toEqual({ days: 1, hours: 2, minutes: 5 }); + }); + + it('FE-FLIGHTLIVE-MODEL-010: tells the clock at the airport, in 24 or 12 hours, and survives a bad zone', () => { + expect(airportTime(DEP, 'Europe/Berlin', 'en-GB', '24h')).toBe('13:50'); + expect(airportTime(DEP, 'America/New_York', 'en-US', '12h')).toMatch(/7:50\s?AM/); + expect(() => airportTime(DEP, 'Not/AZone', 'en-GB', '24h')).not.toThrow(); + expect(toMs('nonsense')).toBeNull(); + }); + + it('FE-FLIGHTLIVE-MODEL-012: picks the leg a summary speaks for', () => { + const first = leg({ leg_index: 0, phase: 'landed', landed_at: new Date(ARR).toISOString() }); + const second = leg({ + leg_index: 1, + scheduled_departure: new Date(ARR + 2 * H).toISOString(), + scheduled_arrival: new Date(ARR + 4 * H).toISOString(), + }); + expect(currentLeg([], ARR)).toBeNull(); + expect(currentLeg([first, second], ARR + H)?.leg_index).toBe(1); + expect(currentLeg([first, { ...second, phase: 'airborne' }], ARR + 3 * H)?.leg_index).toBe(1); + expect(currentLeg([first], ARR + H)?.leg_index).toBe(0); + }); +}); diff --git a/client/src/utils/flightLiveModel.ts b/client/src/utils/flightLiveModel.ts new file mode 100644 index 000000000..381a7827c --- /dev/null +++ b/client/src/utils/flightLiveModel.ts @@ -0,0 +1,161 @@ +import type { FlightLiveLeg } from '@trek/shared'; + +/** + * What a live flight card shows, worked out from one leg's state and the clock. + * Pure on purpose: the desktop dialog, the mobile sheet, the plan rows and the + * home-screen widget snapshot all read the same view, so a flight never says + * "in the air" in one place and "departs in 5 min" in another. + */ + +/** + * - upcoming: departure more than three hours away. + * - soon: within three hours of departure, nothing seen yet. + * - taxiing: seen on the ground at the departure airport. + * - airborne: in the air. + * - landed: on the ground at the destination. + * - past: the schedule is over and the feed never confirmed the flight. + * - unknown: the departure time has passed and the callsign never showed up. + */ +type FlightStage = 'upcoming' | 'soon' | 'taxiing' | 'airborne' | 'landed' | 'past' | 'unknown'; + +/** ok: on time or early; minor: up to half an hour; major: more. */ +export type DelayTone = 'ok' | 'minor' | 'major'; + +export interface FlightLiveView { + stage: FlightStage; + /** Share of the way flown, 0 to 1, for placing the aircraft on the arc. */ + progress: number; + depPlanned: number | null; + /** Observed wheels-up. */ + depActual: number | null; + arrPlanned: number | null; + /** Touchdown once landed, the estimate while flying, else null. */ + arrExpected: number | null; + arrIsEstimate: boolean; + depDelay: number | null; + arrDelay: number | null; + /** Milliseconds to departure (before take-off) or to arrival (in the air). */ + countdownMs: number | null; + /** The feed has heard this aircraft at least once. */ + heard: boolean; + stale: boolean; +} + +const SOON_MS = 3 * 60 * 60 * 1000; +const PAST_MS = 60 * 60 * 1000; +const KEEP_LANDED_MS = 6 * 60 * 60 * 1000; + +export const toMs = (iso: string | null | undefined): number | null => { + if (!iso) return null; + const ms = Date.parse(iso); + return Number.isFinite(ms) ? ms : null; +}; + +const clamp01 = (n: number): number => Math.min(1, Math.max(0, n)); + +export function delayTone(minutes: number | null): DelayTone { + if (minutes == null || minutes <= 5) return 'ok'; + return minutes < 30 ? 'minor' : 'major'; +} + +function stageOf(leg: FlightLiveLeg, now: number, depPlanned: number | null, arrPlanned: number | null): FlightStage { + // A landing, or a flight never heard, says nothing anymore hours after its arrival. + const end = toMs(leg.landed_at) ?? arrPlanned; + if ((leg.phase === 'landed' || leg.phase === 'unknown') && end != null && now > end + KEEP_LANDED_MS) return 'past'; + switch (leg.phase) { + case 'taxiing': + case 'airborne': + case 'landed': + case 'unknown': + return leg.phase; + case 'scheduled': + if (arrPlanned != null && now > arrPlanned + PAST_MS) return 'past'; + if (depPlanned != null && depPlanned - now <= SOON_MS) return 'soon'; + return 'upcoming'; + } +} + +export function flightLiveView(leg: FlightLiveLeg, now: number): FlightLiveView { + const depPlanned = toMs(leg.scheduled_departure); + const arrPlanned = toMs(leg.scheduled_arrival); + const depActual = toMs(leg.departed_at); + const landedAt = toMs(leg.landed_at); + const estimate = toMs(leg.estimated_arrival); + const stage = stageOf(leg, now, depPlanned, arrPlanned); + + const arrExpected = landedAt ?? (stage === 'airborne' ? estimate : null); + const arrIsEstimate = landedAt == null && arrExpected != null; + + let progress = 0; + if (stage === 'landed' || stage === 'past') progress = 1; + else if (stage === 'airborne') { + if (leg.progress != null) progress = leg.progress; + else { + // No position to measure by (stale over an ocean): place it by the clock. + const start = depActual ?? depPlanned; + const end = arrExpected ?? arrPlanned; + if (start != null && end != null && end > start) progress = clamp01((now - start) / (end - start)); + } + } + + let countdownMs: number | null = null; + if ((stage === 'upcoming' || stage === 'soon') && depPlanned != null) countdownMs = Math.max(0, depPlanned - now); + if (stage === 'airborne') { + const end = arrExpected ?? arrPlanned; + if (end != null) countdownMs = Math.max(0, end - now); + } + + return { + stage, + progress: clamp01(progress), + depPlanned, + depActual, + arrPlanned, + arrExpected, + arrIsEstimate, + depDelay: leg.departure_delay_min, + arrDelay: leg.arrival_delay_min, + countdownMs, + heard: leg.last_seen_at != null, + stale: leg.stale, + }; +} + +/** Whole hours and minutes of a duration, rounded up to the next minute. */ +export function splitDuration(ms: number): { days: number; hours: number; minutes: number } { + const total = Math.ceil(ms / 60_000); + return { days: Math.floor(total / 1440), hours: Math.floor((total % 1440) / 60), minutes: total % 60 }; +} + +/** Clock time at an airport, in the user's 12/24 h preference. */ +export function airportTime(ms: number, timezone: string | null, locale: string, timeFormat: string): string { + try { + return new Intl.DateTimeFormat(locale, { + hour: 'numeric', + minute: '2-digit', + hour12: timeFormat === '12h', + timeZone: timezone || undefined, + }).format(ms); + } catch { + // An unknown zone name from an old booking: the device zone is a better answer than none. + return new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit', hour12: timeFormat === '12h' }).format( + ms + ); + } +} + +/** + * The leg of a multi-leg booking a one-line summary should speak for: the one + * in the air or on the ground about to leave, else the next one ahead, else + * the last one. Null when nothing is followed. + */ +export function currentLeg(legs: FlightLiveLeg[], now: number): FlightLiveLeg | null { + if (legs.length === 0) return null; + const moving = legs.find((leg) => leg.phase === 'airborne' || leg.phase === 'taxiing'); + if (moving) return moving; + const ahead = legs.find((leg) => { + const arr = toMs(leg.landed_at) ?? toMs(leg.scheduled_arrival); + return leg.phase !== 'landed' && (arr == null || arr > now); + }); + return ahead ?? legs[legs.length - 1]; +} diff --git a/shared/src/i18n/ar/flightLive.ts b/shared/src/i18n/ar/flightLive.ts new file mode 100644 index 000000000..7fd1886da --- /dev/null +++ b/shared/src/i18n/ar/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} ي {h} س', + 'flightLive.durHoursMinutes': '{h} س {m} د', + 'flightLive.durMinutes': '{m} د', + 'flightLive.late': '+{m} د', + 'flightLive.early': 'أبكر بـ {m} د', + 'flightLive.onTime': 'في الموعد', + 'flightLive.departsIn': 'الإقلاع بعد {time}', + 'flightLive.scheduled': 'مجدولة', + 'flightLive.watching': 'TREK يترقب الطائرة', + 'flightLive.taxiing': 'جاهزة للإقلاع', + 'flightLive.atAirport': 'على الأرض في {code}', + 'flightLive.airborne': 'في الجو', + 'flightLive.landsIn': 'الهبوط بعد {time}', + 'flightLive.landed': 'هبطت', + 'flightLive.landedAt': 'هبطت الساعة {time} في {code}', + 'flightLive.over': 'انتهت الرحلة', + 'flightLive.noSignal': 'لا توجد بيانات مباشرة', + 'flightLive.noSignalHint': 'شبكة بيانات الطيران المفتوحة لا تعرف هذه الرحلة برقمها.', + 'flightLive.estimated': 'متوقع', + 'flightLive.actual': 'فعلي', + 'flightLive.altitude': 'الارتفاع', + 'flightLive.feet': '{n} قدم', + 'flightLive.meters': '{n} م', + 'flightLive.speed': 'السرعة', + 'flightLive.mph': '{n} ميل/س', + 'flightLive.kmh': '{n} كم/س', + 'flightLive.remaining': 'المتبقي', + 'flightLive.mi': '{n} ميل', + 'flightLive.km': '{n} كم', + 'flightLive.aircraft': 'الطائرة', + 'flightLive.lastSignal': 'آخر إشارة قبل {time}', + 'flightLive.updated': 'تم التحديث قبل {time}', + 'flightLive.noGateHint': + 'البوابة والمبنى وحزام الأمتعة ليست ضمن بيانات الطيران المفتوحة. أضفها بنفسك إلى الحجز إذا احتجت إليها.', + 'flightLive.legOf': 'الرحلة {n} من {total}', + 'flightLive.adminTitle': 'حالة الرحلات المباشرة', + 'flightLive.adminHint': + 'يعرض موقع الرحلات المحجوزة وتأخيرها ووصولها المتوقع من بيانات ADS-B المفتوحة (adsb.lol وadsb.fi). لا يغادر هذا الخادم سوى رمز النداء الخاص بالرحلة.', + 'flightLive.adminToggle': 'تتبع الرحلات المحجوزة مباشرة', + 'flightLive.headlineDetail': '{headline}، {detail}', + 'flightLive.adminHintManaged': + 'يعرض موقع الرحلات المحجوزة وتأخيرها ووصولها المتوقع من بيانات ADS-B المفتوحة (adsb.lol). لا يغادر المثيل سوى رمز النداء الخاص بالرحلة.', + 'flightLive.noFlight': 'لا توجد رحلة قادمة', + 'flightLive.envLocked': 'مضبوط عبر FLIGHT_LIVE_ENABLED على الخادم ولا يمكن تغييره هنا.', +}; + +export default flightLive; diff --git a/shared/src/i18n/ar/index.ts b/shared/src/i18n/ar/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/ar/index.ts +++ b/shared/src/i18n/ar/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/az/flightLive.ts b/shared/src/i18n/az/flightLive.ts new file mode 100644 index 000000000..d4bd31f85 --- /dev/null +++ b/shared/src/i18n/az/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} g {h} s', + 'flightLive.durHoursMinutes': '{h} s {m} dəq', + 'flightLive.durMinutes': '{m} dəq', + 'flightLive.late': '+{m} dəq', + 'flightLive.early': '{m} dəq tez', + 'flightLive.onTime': 'Vaxtında', + 'flightLive.departsIn': '{time} sonra uçuş', + 'flightLive.scheduled': 'Planlaşdırılıb', + 'flightLive.watching': 'TREK təyyarəni gözləyir', + 'flightLive.taxiing': 'Uçuşa hazırdır', + 'flightLive.atAirport': '{code} yerdədir', + 'flightLive.airborne': 'Havada', + 'flightLive.landsIn': '{time} sonra eniş', + 'flightLive.landed': 'Endi', + 'flightLive.landedAt': '{time} {code} endi', + 'flightLive.over': 'Uçuş bitdi', + 'flightLive.noSignal': 'Canlı məlumat yoxdur', + 'flightLive.noSignalHint': 'Açıq uçuş məlumat şəbəkəsi bu uçuşu nömrəsinə görə tanımır.', + 'flightLive.estimated': 'gözlənilən', + 'flightLive.actual': 'faktiki', + 'flightLive.altitude': 'Hündürlük', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Sürət', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/s', + 'flightLive.remaining': 'Qalıb', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Təyyarə', + 'flightLive.lastSignal': 'Son siqnal {time} əvvəl', + 'flightLive.updated': '{time} əvvəl yeniləndi', + 'flightLive.noGateHint': + 'Qapı, terminal və baqaj lenti açıq uçuş məlumatlarına daxil deyil. Lazım olsa, onları bronlamaya özün əlavə et.', + 'flightLive.legOf': 'Uçuş {n} / {total}', + 'flightLive.adminTitle': 'Canlı uçuş statusu', + 'flightLive.adminHint': + 'Açıq ADS-B məlumatlarından (adsb.lol, adsb.fi) sifariş edilmiş uçuşların mövqeyini, gecikməsini və təxmini gəlişini göstərir. Bu serverdən yalnız uçuşun çağırış işarəsi çıxır.', + 'flightLive.adminToggle': 'Sifariş edilmiş uçuşları canlı izlə', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Açıq ADS-B məlumatlarından (adsb.lol) sifariş edilmiş uçuşların mövqeyini, gecikməsini və təxmini gəlişini göstərir. Nümunədən yalnız uçuşun çağırış işarəsi çıxır.', + 'flightLive.noFlight': 'Qarşıda uçuş yoxdur', + 'flightLive.envLocked': 'Serverdə FLIGHT_LIVE_ENABLED ilə təyin olunub, burada dəyişdirilə bilməz.', +}; + +export default flightLive; diff --git a/shared/src/i18n/az/index.ts b/shared/src/i18n/az/index.ts index 1a0ff1d80..bb9ce471c 100644 --- a/shared/src/i18n/az/index.ts +++ b/shared/src/i18n/az/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/br/flightLive.ts b/shared/src/i18n/br/flightLive.ts new file mode 100644 index 000000000..d246755f2 --- /dev/null +++ b/shared/src/i18n/br/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min adiantado', + 'flightLive.onTime': 'No horário', + 'flightLive.departsIn': 'Parte em {time}', + 'flightLive.scheduled': 'Programado', + 'flightLive.watching': 'O TREK está de olho no avião', + 'flightLive.taxiing': 'Pronto para partir', + 'flightLive.atAirport': 'Em solo em {code}', + 'flightLive.airborne': 'No ar', + 'flightLive.landsIn': 'Pousa em {time}', + 'flightLive.landed': 'Pousou', + 'flightLive.landedAt': 'Pousou às {time} em {code}', + 'flightLive.over': 'Voo encerrado', + 'flightLive.noSignal': 'Sem dados ao vivo', + 'flightLive.noSignalHint': 'A rede aberta de dados de voo não conhece este voo pelo número.', + 'flightLive.estimated': 'estimado', + 'flightLive.actual': 'real', + 'flightLive.altitude': 'Altitude', // same-as-en + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Velocidade', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Restante', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Aeronave', + 'flightLive.lastSignal': 'Último sinal há {time}', + 'flightLive.updated': 'Atualizado há {time}', + 'flightLive.noGateHint': + 'Portão, terminal e esteira de bagagem não fazem parte dos dados de voo abertos. Adicione-os você mesmo à reserva se precisar.', + 'flightLive.legOf': 'Voo {n} de {total}', + 'flightLive.adminTitle': 'Status de voo ao vivo', + 'flightLive.adminHint': + 'Mostra posição, atraso e chegada estimada dos voos reservados a partir de dados ADS-B abertos (adsb.lol, adsb.fi). Só o indicativo do voo sai deste servidor.', + 'flightLive.adminToggle': 'Acompanhar voos reservados ao vivo', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Mostra posição, atraso e chegada estimada dos voos reservados a partir de dados ADS-B abertos (adsb.lol). Só o indicativo do voo sai da instância.', + 'flightLive.noFlight': 'Nenhum voo previsto', + 'flightLive.envLocked': 'Definido por FLIGHT_LIVE_ENABLED no servidor e não pode ser alterado aqui.', +}; + +export default flightLive; diff --git a/shared/src/i18n/br/index.ts b/shared/src/i18n/br/index.ts index 92d2aca27..2a7b65d09 100644 --- a/shared/src/i18n/br/index.ts +++ b/shared/src/i18n/br/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/ca/flightLive.ts b/shared/src/i18n/ca/flightLive.ts new file mode 100644 index 000000000..a54702557 --- /dev/null +++ b/shared/src/i18n/ca/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min abans', + 'flightLive.onTime': 'Puntual', + 'flightLive.departsIn': 'Surt d’aquí a {time}', + 'flightLive.scheduled': 'Programat', + 'flightLive.watching': 'TREK està atent a l’avió', + 'flightLive.taxiing': 'A punt per sortir', + 'flightLive.atAirport': 'A terra a {code}', + 'flightLive.airborne': 'En vol', + 'flightLive.landsIn': 'Aterra d’aquí a {time}', + 'flightLive.landed': 'Aterrat', + 'flightLive.landedAt': 'Ha aterrat a les {time} a {code}', + 'flightLive.over': 'Vol acabat', + 'flightLive.noSignal': 'Sense dades en directe', + 'flightLive.noSignalHint': 'La xarxa oberta de dades de vol no coneix aquest vol pel seu número.', + 'flightLive.estimated': 'estimada', + 'flightLive.actual': 'real', + 'flightLive.altitude': 'Altitud', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Velocitat', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Restant', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Avió', + 'flightLive.lastSignal': 'Darrer senyal fa {time}', + 'flightLive.updated': 'Actualitzat fa {time}', + 'flightLive.noGateHint': + 'La porta, la terminal i la cinta d’equipatge no formen part de les dades de vol obertes. Afegeix-les tu a la reserva si les necessites.', + 'flightLive.legOf': 'Vol {n} de {total}', + 'flightLive.adminTitle': 'Estat dels vols en directe', + 'flightLive.adminHint': + 'Mostra la posició, el retard i l’arribada estimada dels vols reservats a partir de dades ADS-B obertes (adsb.lol, adsb.fi). Només l’indicatiu del vol surt d’aquest servidor.', + 'flightLive.adminToggle': 'Segueix en directe els vols reservats', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Mostra la posició, el retard i l’arribada estimada dels vols reservats a partir de dades ADS-B obertes (adsb.lol). Només l’indicatiu del vol surt de la instància.', + 'flightLive.noFlight': 'Cap vol previst', + 'flightLive.envLocked': 'Definit per FLIGHT_LIVE_ENABLED al servidor i no es pot canviar aquí.', +}; + +export default flightLive; diff --git a/shared/src/i18n/ca/index.ts b/shared/src/i18n/ca/index.ts index 5c85fc409..8b23911a3 100644 --- a/shared/src/i18n/ca/index.ts +++ b/shared/src/i18n/ca/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/cs/flightLive.ts b/shared/src/i18n/cs/flightLive.ts new file mode 100644 index 000000000..b1291878c --- /dev/null +++ b/shared/src/i18n/cs/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': 'o {m} min dříve', + 'flightLive.onTime': 'Včas', + 'flightLive.departsIn': 'Odlet za {time}', + 'flightLive.scheduled': 'Plánováno', + 'flightLive.watching': 'TREK vyhlíží letadlo', + 'flightLive.taxiing': 'Připraveno k odletu', + 'flightLive.atAirport': 'Na zemi v {code}', + 'flightLive.airborne': 'Ve vzduchu', + 'flightLive.landsIn': 'Přistane za {time}', + 'flightLive.landed': 'Přistálo', + 'flightLive.landedAt': 'Přistálo v {time} v {code}', + 'flightLive.over': 'Let skončil', + 'flightLive.noSignal': 'Žádná živá data', + 'flightLive.noSignalHint': 'Otevřená síť letových dat tento let pod jeho číslem nezná.', + 'flightLive.estimated': 'odhad', + 'flightLive.actual': 'skutečnost', + 'flightLive.altitude': 'Výška', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Rychlost', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Zbývá', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Letadlo', + 'flightLive.lastSignal': 'Poslední signál před {time}', + 'flightLive.updated': 'Aktualizováno před {time}', + 'flightLive.noGateHint': + 'Gate, terminál a pás zavazadel nejsou součástí otevřených letových dat. Pokud je potřebuješ, doplň je do rezervace sám.', + 'flightLive.legOf': 'Let {n} z {total}', + 'flightLive.adminTitle': 'Živý stav letů', + 'flightLive.adminHint': + 'Zobrazuje polohu, zpoždění a odhadovaný přílet rezervovaných letů z otevřených dat ADS-B (adsb.lol, adsb.fi). Server opouští jen volací znak letu.', + 'flightLive.adminToggle': 'Sledovat rezervované lety živě', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Zobrazuje polohu, zpoždění a odhadovaný přílet rezervovaných letů z otevřených dat ADS-B (adsb.lol). Instanci opouští jen volací znak letu.', + 'flightLive.noFlight': 'Žádný naplánovaný let', + 'flightLive.envLocked': 'Nastaveno přes FLIGHT_LIVE_ENABLED na serveru, zde to nelze změnit.', +}; + +export default flightLive; diff --git a/shared/src/i18n/cs/index.ts b/shared/src/i18n/cs/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/cs/index.ts +++ b/shared/src/i18n/cs/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/de/flightLive.ts b/shared/src/i18n/de/flightLive.ts new file mode 100644 index 000000000..50a1915a0 --- /dev/null +++ b/shared/src/i18n/de/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} T {h} Std', + 'flightLive.durHoursMinutes': '{h} Std {m} Min', + 'flightLive.durMinutes': '{m} Min', + 'flightLive.late': '+{m} Min', + 'flightLive.early': '{m} Min früher', + 'flightLive.onTime': 'Pünktlich', + 'flightLive.departsIn': 'Abflug in {time}', + 'flightLive.scheduled': 'Geplant', + 'flightLive.watching': 'TREK hält Ausschau nach der Maschine', + 'flightLive.taxiing': 'Bereit zum Abflug', + 'flightLive.atAirport': 'Am Boden in {code}', + 'flightLive.airborne': 'In der Luft', + 'flightLive.landsIn': 'Landung in {time}', + 'flightLive.landed': 'Gelandet', + 'flightLive.landedAt': 'Gelandet um {time} in {code}', + 'flightLive.over': 'Flug vorbei', + 'flightLive.noSignal': 'Keine Live-Daten', + 'flightLive.noSignalHint': 'Im offenen Flugdatennetz ist dieser Flug unter seiner Nummer nicht zu finden.', + 'flightLive.estimated': 'erwartet', + 'flightLive.actual': 'tatsächlich', + 'flightLive.altitude': 'Höhe', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Tempo', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Verbleibend', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Flugzeug', + 'flightLive.lastSignal': 'Letztes Signal vor {time}', + 'flightLive.updated': 'Aktualisiert vor {time}', + 'flightLive.noGateHint': + 'Gate, Terminal und Gepäckband gehören nicht zu den offenen Flugdaten. Trag sie bei Bedarf selbst in die Buchung ein.', + 'flightLive.legOf': 'Flug {n} von {total}', + 'flightLive.adminTitle': 'Live-Flugstatus', + 'flightLive.adminHint': + 'Zeigt Position, Verspätung und voraussichtliche Ankunft gebuchter Flüge aus offenen ADS-B-Daten (adsb.lol, adsb.fi). Nur das Rufzeichen des Flugs verlässt diesen Server.', + 'flightLive.adminToggle': 'Gebuchte Flüge live verfolgen', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Zeigt Position, Verspätung und voraussichtliche Ankunft gebuchter Flüge aus offenen ADS-B-Daten (adsb.lol). Nur das Rufzeichen des Flugs verlässt die Instanz.', + 'flightLive.noFlight': 'Kein Flug geplant', + 'flightLive.envLocked': 'Auf dem Server per FLIGHT_LIVE_ENABLED festgelegt und hier nicht änderbar.', +}; + +export default flightLive; diff --git a/shared/src/i18n/de/index.ts b/shared/src/i18n/de/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/de/index.ts +++ b/shared/src/i18n/de/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/en/flightLive.ts b/shared/src/i18n/en/flightLive.ts new file mode 100644 index 000000000..f31ee89f9 --- /dev/null +++ b/shared/src/i18n/en/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min early', + 'flightLive.onTime': 'On time', + 'flightLive.departsIn': 'Departs in {time}', + 'flightLive.scheduled': 'Scheduled', + 'flightLive.watching': 'TREK is watching for the aircraft', + 'flightLive.taxiing': 'Ready for departure', + 'flightLive.atAirport': 'On the ground at {code}', + 'flightLive.airborne': 'In the air', + 'flightLive.landsIn': 'Lands in {time}', + 'flightLive.landed': 'Landed', + 'flightLive.landedAt': 'Landed at {time} in {code}', + 'flightLive.over': 'Flight over', + 'flightLive.noSignal': 'No live data', + 'flightLive.noSignalHint': 'The open flight data network does not know this flight under its number.', + 'flightLive.estimated': 'estimated', + 'flightLive.actual': 'actual', + 'flightLive.altitude': 'Altitude', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Speed', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Remaining', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Aircraft', + 'flightLive.lastSignal': 'Last signal {time} ago', + 'flightLive.updated': 'Updated {time} ago', + 'flightLive.noGateHint': + 'Gate, terminal and baggage belt are not part of open flight data. Add them to the booking yourself if you need them.', + 'flightLive.legOf': 'Flight {n} of {total}', + 'flightLive.adminTitle': 'Live flight status', + 'flightLive.adminHint': + 'Shows position, delay and estimated arrival of booked flights from open ADS-B data (adsb.lol, adsb.fi). Only the callsign of the flight leaves this server.', + 'flightLive.adminToggle': 'Follow booked flights live', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Shows position, delay and estimated arrival of booked flights from open ADS-B data (adsb.lol). Only the callsign of the flight leaves the instance.', + 'flightLive.noFlight': 'No flight ahead', + 'flightLive.envLocked': 'Set by FLIGHT_LIVE_ENABLED on the server and cannot be changed here.', +}; + +export default flightLive; diff --git a/shared/src/i18n/en/index.ts b/shared/src/i18n/en/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/en/index.ts +++ b/shared/src/i18n/en/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/es/flightLive.ts b/shared/src/i18n/es/flightLive.ts new file mode 100644 index 000000000..c81284c79 --- /dev/null +++ b/shared/src/i18n/es/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min antes', + 'flightLive.onTime': 'Puntual', + 'flightLive.departsIn': 'Sale en {time}', + 'flightLive.scheduled': 'Programado', + 'flightLive.watching': 'TREK está atento al avión', + 'flightLive.taxiing': 'Listo para salir', + 'flightLive.atAirport': 'En tierra en {code}', + 'flightLive.airborne': 'En el aire', + 'flightLive.landsIn': 'Aterriza en {time}', + 'flightLive.landed': 'Aterrizado', + 'flightLive.landedAt': 'Aterrizó a las {time} en {code}', + 'flightLive.over': 'Vuelo terminado', + 'flightLive.noSignal': 'Sin datos en directo', + 'flightLive.noSignalHint': 'La red abierta de datos de vuelo no conoce este vuelo por su número.', + 'flightLive.estimated': 'estimada', + 'flightLive.actual': 'real', + 'flightLive.altitude': 'Altitud', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Velocidad', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Restante', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Avión', + 'flightLive.lastSignal': 'Última señal hace {time}', + 'flightLive.updated': 'Actualizado hace {time}', + 'flightLive.noGateHint': + 'La puerta, la terminal y la cinta de equipaje no forman parte de los datos de vuelo abiertos. Añádelos tú a la reserva si los necesitas.', + 'flightLive.legOf': 'Vuelo {n} de {total}', + 'flightLive.adminTitle': 'Estado de vuelos en directo', + 'flightLive.adminHint': + 'Muestra la posición, el retraso y la llegada estimada de los vuelos reservados a partir de datos ADS-B abiertos (adsb.lol, adsb.fi). Solo el indicativo del vuelo sale de este servidor.', + 'flightLive.adminToggle': 'Seguir en directo los vuelos reservados', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Muestra la posición, el retraso y la llegada estimada de los vuelos reservados a partir de datos ADS-B abiertos (adsb.lol). Solo el indicativo del vuelo sale de la instancia.', + 'flightLive.noFlight': 'Ningún vuelo próximo', + 'flightLive.envLocked': 'Definido por FLIGHT_LIVE_ENABLED en el servidor y no se puede cambiar aquí.', +}; + +export default flightLive; diff --git a/shared/src/i18n/es/index.ts b/shared/src/i18n/es/index.ts index 6010d641c..6525ebe9c 100644 --- a/shared/src/i18n/es/index.ts +++ b/shared/src/i18n/es/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/et/flightLive.ts b/shared/src/i18n/et/flightLive.ts new file mode 100644 index 000000000..7e9299417 --- /dev/null +++ b/shared/src/i18n/et/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} p {h} t', + 'flightLive.durHoursMinutes': '{h} t {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min varem', + 'flightLive.onTime': 'Õigel ajal', + 'flightLive.departsIn': 'Väljub {time} pärast', + 'flightLive.scheduled': 'Plaanitud', + 'flightLive.watching': 'TREK ootab lennukit', + 'flightLive.taxiing': 'Valmis väljumiseks', + 'flightLive.atAirport': 'Maapinnal: {code}', + 'flightLive.airborne': 'Õhus', + 'flightLive.landsIn': 'Maandub {time} pärast', + 'flightLive.landed': 'Maandunud', + 'flightLive.landedAt': 'Maandus kell {time}: {code}', + 'flightLive.over': 'Lend on läbi', + 'flightLive.noSignal': 'Otseandmed puuduvad', + 'flightLive.noSignalHint': 'Avatud lennuandmete võrk ei tunne seda lendu selle numbri järgi.', + 'flightLive.estimated': 'eeldatav', + 'flightLive.actual': 'tegelik', + 'flightLive.altitude': 'Kõrgus', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Kiirus', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Jäänud', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Lennuk', + 'flightLive.lastSignal': 'Viimane signaal {time} tagasi', + 'flightLive.updated': 'Uuendatud {time} tagasi', + 'flightLive.noGateHint': + 'Värav, terminal ja pagasilint ei kuulu avatud lennuandmete hulka. Lisa need vajadusel ise broneeringule.', + 'flightLive.legOf': 'Lend {n}/{total}', + 'flightLive.adminTitle': 'Lennu otsestaatus', + 'flightLive.adminHint': + 'Näitab broneeritud lendude asukohta, hilinemist ja eeldatavat saabumist avatud ADS-B andmetest (adsb.lol, adsb.fi). Serverist lahkub ainult lennu kutsung.', + 'flightLive.adminToggle': 'Jälgi broneeritud lende otse', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Näitab broneeritud lendude asukohta, hilinemist ja eeldatavat saabumist avatud ADS-B andmetest (adsb.lol). Eksemplarist lahkub ainult lennu kutsung.', + 'flightLive.noFlight': 'Eesootavat lendu pole', + 'flightLive.envLocked': 'Määratud serveris muutujaga FLIGHT_LIVE_ENABLED, siin ei saa muuta.', +}; + +export default flightLive; diff --git a/shared/src/i18n/et/index.ts b/shared/src/i18n/et/index.ts index 1a0ff1d80..bb9ce471c 100644 --- a/shared/src/i18n/et/index.ts +++ b/shared/src/i18n/et/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/fr/flightLive.ts b/shared/src/i18n/fr/flightLive.ts new file mode 100644 index 000000000..b7d59602a --- /dev/null +++ b/shared/src/i18n/fr/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} j {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min en avance', + 'flightLive.onTime': 'À l’heure', + 'flightLive.departsIn': 'Départ dans {time}', + 'flightLive.scheduled': 'Prévu', + 'flightLive.watching': 'TREK guette l’avion', + 'flightLive.taxiing': 'Prêt au départ', + 'flightLive.atAirport': 'Au sol à {code}', + 'flightLive.airborne': 'En vol', + 'flightLive.landsIn': 'Atterrit dans {time}', + 'flightLive.landed': 'Atterri', + 'flightLive.landedAt': 'Atterri à {time} à {code}', + 'flightLive.over': 'Vol terminé', + 'flightLive.noSignal': 'Pas de données en direct', + 'flightLive.noSignalHint': 'Le réseau ouvert de données de vol ne connaît pas ce vol sous son numéro.', + 'flightLive.estimated': 'estimé', + 'flightLive.actual': 'réel', + 'flightLive.altitude': 'Altitude', // same-as-en + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Vitesse', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Restant', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Avion', + 'flightLive.lastSignal': 'Dernier signal il y a {time}', + 'flightLive.updated': 'Mis à jour il y a {time}', + 'flightLive.noGateHint': + 'La porte, le terminal et le tapis à bagages ne font pas partie des données de vol ouvertes. Ajoutez-les vous-même à la réservation si besoin.', + 'flightLive.legOf': 'Vol {n} sur {total}', + 'flightLive.adminTitle': 'Statut des vols en direct', + 'flightLive.adminHint': + 'Affiche la position, le retard et l’arrivée estimée des vols réservés à partir de données ADS-B ouvertes (adsb.lol, adsb.fi). Seul l’indicatif du vol quitte ce serveur.', + 'flightLive.adminToggle': 'Suivre les vols réservés en direct', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Affiche la position, le retard et l’arrivée estimée des vols réservés à partir de données ADS-B ouvertes (adsb.lol). Seul l’indicatif du vol quitte l’instance.', + 'flightLive.noFlight': 'Aucun vol à venir', + 'flightLive.envLocked': 'Défini par FLIGHT_LIVE_ENABLED sur le serveur et non modifiable ici.', +}; + +export default flightLive; diff --git a/shared/src/i18n/fr/index.ts b/shared/src/i18n/fr/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/fr/index.ts +++ b/shared/src/i18n/fr/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/gr/flightLive.ts b/shared/src/i18n/gr/flightLive.ts new file mode 100644 index 000000000..4dc34e260 --- /dev/null +++ b/shared/src/i18n/gr/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} ημ {h} ώ', + 'flightLive.durHoursMinutes': '{h} ώ {m} λ', + 'flightLive.durMinutes': '{m} λ', + 'flightLive.late': '+{m} λ', + 'flightLive.early': '{m} λ νωρίτερα', + 'flightLive.onTime': 'Στην ώρα της', + 'flightLive.departsIn': 'Αναχώρηση σε {time}', + 'flightLive.scheduled': 'Προγραμματισμένη', + 'flightLive.watching': 'Το TREK περιμένει το αεροσκάφος', + 'flightLive.taxiing': 'Έτοιμη για αναχώρηση', + 'flightLive.atAirport': 'Στο έδαφος στο {code}', + 'flightLive.airborne': 'Στον αέρα', + 'flightLive.landsIn': 'Προσγείωση σε {time}', + 'flightLive.landed': 'Προσγειώθηκε', + 'flightLive.landedAt': 'Προσγειώθηκε στις {time} στο {code}', + 'flightLive.over': 'Η πτήση ολοκληρώθηκε', + 'flightLive.noSignal': 'Δεν υπάρχουν ζωντανά δεδομένα', + 'flightLive.noSignalHint': 'Το ανοιχτό δίκτυο δεδομένων πτήσεων δεν γνωρίζει αυτή την πτήση με τον αριθμό της.', + 'flightLive.estimated': 'εκτιμώμενη', + 'flightLive.actual': 'πραγματική', + 'flightLive.altitude': 'Ύψος', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Ταχύτητα', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Απομένουν', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Αεροσκάφος', + 'flightLive.lastSignal': 'Τελευταίο σήμα πριν από {time}', + 'flightLive.updated': 'Ενημερώθηκε πριν από {time}', + 'flightLive.noGateHint': + 'Η πύλη, ο τερματικός σταθμός και ο ιμάντας αποσκευών δεν ανήκουν στα ανοιχτά δεδομένα πτήσεων. Πρόσθεσέ τα μόνος σου στην κράτηση αν τα χρειάζεσαι.', + 'flightLive.legOf': 'Πτήση {n} από {total}', + 'flightLive.adminTitle': 'Ζωντανή κατάσταση πτήσεων', + 'flightLive.adminHint': + 'Δείχνει θέση, καθυστέρηση και εκτιμώμενη άφιξη κρατημένων πτήσεων από ανοιχτά δεδομένα ADS-B (adsb.lol, adsb.fi). Μόνο το διακριτικό κλήσης της πτήσης φεύγει από αυτόν τον διακομιστή.', + 'flightLive.adminToggle': 'Ζωντανή παρακολούθηση κρατημένων πτήσεων', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Δείχνει θέση, καθυστέρηση και εκτιμώμενη άφιξη κρατημένων πτήσεων από ανοιχτά δεδομένα ADS-B (adsb.lol). Μόνο το διακριτικό κλήσης της πτήσης φεύγει από την εγκατάσταση.', + 'flightLive.noFlight': 'Καμία προσεχής πτήση', + 'flightLive.envLocked': 'Ορίζεται από το FLIGHT_LIVE_ENABLED στον διακομιστή και δεν αλλάζει εδώ.', +}; + +export default flightLive; diff --git a/shared/src/i18n/gr/index.ts b/shared/src/i18n/gr/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/gr/index.ts +++ b/shared/src/i18n/gr/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/he/flightLive.ts b/shared/src/i18n/he/flightLive.ts new file mode 100644 index 000000000..c7bcdec22 --- /dev/null +++ b/shared/src/i18n/he/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} י׳ {h} ש׳', + 'flightLive.durHoursMinutes': '{h} ש׳ {m} ד׳', + 'flightLive.durMinutes': '{m} ד׳', + 'flightLive.late': '+{m} ד׳', + 'flightLive.early': 'מוקדם ב־{m} ד׳', + 'flightLive.onTime': 'בזמן', + 'flightLive.departsIn': 'המראה בעוד {time}', + 'flightLive.scheduled': 'מתוכננת', + 'flightLive.watching': 'TREK מחכה למטוס', + 'flightLive.taxiing': 'מוכנה להמראה', + 'flightLive.atAirport': 'על הקרקע ב־{code}', + 'flightLive.airborne': 'באוויר', + 'flightLive.landsIn': 'נחיתה בעוד {time}', + 'flightLive.landed': 'נחתה', + 'flightLive.landedAt': 'נחתה ב־{time} ב־{code}', + 'flightLive.over': 'הטיסה הסתיימה', + 'flightLive.noSignal': 'אין נתונים חיים', + 'flightLive.noSignalHint': 'רשת נתוני הטיסות הפתוחה לא מכירה את הטיסה הזו לפי המספר שלה.', + 'flightLive.estimated': 'משוער', + 'flightLive.actual': 'בפועל', + 'flightLive.altitude': 'גובה', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} מ׳', + 'flightLive.speed': 'מהירות', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} קמ״ש', + 'flightLive.remaining': 'נותרו', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} ק״מ', + 'flightLive.aircraft': 'מטוס', + 'flightLive.lastSignal': 'אות אחרון לפני {time}', + 'flightLive.updated': 'עודכן לפני {time}', + 'flightLive.noGateHint': + 'שער, טרמינל ומסוע מזוודות אינם חלק מנתוני הטיסות הפתוחים. הוסיפו אותם בעצמכם להזמנה אם צריך.', + 'flightLive.legOf': 'טיסה {n} מתוך {total}', + 'flightLive.adminTitle': 'סטטוס טיסות חי', + 'flightLive.adminHint': + 'מציג מיקום, עיכוב והגעה משוערת של טיסות שהוזמנו מנתוני ADS-B פתוחים (adsb.lol, adsb.fi). רק אות הקריאה של הטיסה יוצא מהשרת הזה.', + 'flightLive.adminToggle': 'מעקב חי אחר טיסות שהוזמנו', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'מציג מיקום, עיכוב והגעה משוערת של טיסות שהוזמנו מנתוני ADS-B פתוחים (adsb.lol). רק אות הקריאה של הטיסה יוצא מהמופע.', + 'flightLive.noFlight': 'אין טיסה קרובה', + 'flightLive.envLocked': 'נקבע על ידי FLIGHT_LIVE_ENABLED בשרת ולא ניתן לשנות כאן.', +}; + +export default flightLive; diff --git a/shared/src/i18n/he/index.ts b/shared/src/i18n/he/index.ts index 9e2a4afbd..a58e37e01 100644 --- a/shared/src/i18n/he/index.ts +++ b/shared/src/i18n/he/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/hu/flightLive.ts b/shared/src/i18n/hu/flightLive.ts new file mode 100644 index 000000000..66c4a5831 --- /dev/null +++ b/shared/src/i18n/hu/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} nap {h} óra', + 'flightLive.durHoursMinutes': '{h} óra {m} perc', + 'flightLive.durMinutes': '{m} perc', + 'flightLive.late': '+{m} perc', + 'flightLive.early': '{m} perccel korábban', + 'flightLive.onTime': 'Pontos', + 'flightLive.departsIn': 'Indulás {time} múlva', + 'flightLive.scheduled': 'Tervezett', + 'flightLive.watching': 'A TREK figyeli a gépet', + 'flightLive.taxiing': 'Indulásra kész', + 'flightLive.atAirport': 'A földön itt: {code}', + 'flightLive.airborne': 'A levegőben', + 'flightLive.landsIn': 'Leszállás {time} múlva', + 'flightLive.landed': 'Leszállt', + 'flightLive.landedAt': '{time}-kor leszállt itt: {code}', + 'flightLive.over': 'A járat véget ért', + 'flightLive.noSignal': 'Nincs élő adat', + 'flightLive.noSignalHint': 'A nyílt repülési adathálózat nem ismeri ezt a járatot a számáról.', + 'flightLive.estimated': 'várható', + 'flightLive.actual': 'tényleges', + 'flightLive.altitude': 'Magasság', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Sebesség', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Hátralévő', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Repülőgép', + 'flightLive.lastSignal': 'Utolsó jel {time} ezelőtt', + 'flightLive.updated': 'Frissítve {time} ezelőtt', + 'flightLive.noGateHint': + 'A kapu, a terminál és a poggyászszalag nem része a nyílt repülési adatoknak. Szükség esetén add hozzá magad a foglaláshoz.', + 'flightLive.legOf': '{n}. járat / {total}', + 'flightLive.adminTitle': 'Élő járatállapot', + 'flightLive.adminHint': + 'Nyílt ADS-B adatokból (adsb.lol, adsb.fi) mutatja a foglalt járatok helyzetét, késését és várható érkezését. Csak a járat hívójele hagyja el ezt a szervert.', + 'flightLive.adminToggle': 'Foglalt járatok élő követése', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Nyílt ADS-B adatokból (adsb.lol) mutatja a foglalt járatok helyzetét, késését és várható érkezését. Csak a járat hívójele hagyja el a példányt.', + 'flightLive.noFlight': 'Nincs közelgő járat', + 'flightLive.envLocked': 'A szerveren a FLIGHT_LIVE_ENABLED állítja be, itt nem módosítható.', +}; + +export default flightLive; diff --git a/shared/src/i18n/hu/index.ts b/shared/src/i18n/hu/index.ts index 92d2aca27..2a7b65d09 100644 --- a/shared/src/i18n/hu/index.ts +++ b/shared/src/i18n/hu/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/id/flightLive.ts b/shared/src/i18n/id/flightLive.ts new file mode 100644 index 000000000..e8d953e91 --- /dev/null +++ b/shared/src/i18n/id/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} h {h} j', + 'flightLive.durHoursMinutes': '{h} j {m} mnt', + 'flightLive.durMinutes': '{m} mnt', + 'flightLive.late': '+{m} mnt', + 'flightLive.early': '{m} mnt lebih awal', + 'flightLive.onTime': 'Tepat waktu', + 'flightLive.departsIn': 'Berangkat dalam {time}', + 'flightLive.scheduled': 'Terjadwal', + 'flightLive.watching': 'TREK sedang menunggu pesawatnya', + 'flightLive.taxiing': 'Siap berangkat', + 'flightLive.atAirport': 'Di darat di {code}', + 'flightLive.airborne': 'Di udara', + 'flightLive.landsIn': 'Mendarat dalam {time}', + 'flightLive.landed': 'Mendarat', + 'flightLive.landedAt': 'Mendarat pukul {time} di {code}', + 'flightLive.over': 'Penerbangan selesai', + 'flightLive.noSignal': 'Tidak ada data langsung', + 'flightLive.noSignalHint': 'Jaringan data penerbangan terbuka tidak mengenal penerbangan ini dengan nomornya.', + 'flightLive.estimated': 'perkiraan', + 'flightLive.actual': 'aktual', + 'flightLive.altitude': 'Ketinggian', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Kecepatan', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/j', + 'flightLive.remaining': 'Tersisa', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Pesawat', + 'flightLive.lastSignal': 'Sinyal terakhir {time} lalu', + 'flightLive.updated': 'Diperbarui {time} lalu', + 'flightLive.noGateHint': + 'Gerbang, terminal, dan sabuk bagasi tidak termasuk data penerbangan terbuka. Tambahkan sendiri ke pemesanan jika perlu.', + 'flightLive.legOf': 'Penerbangan {n} dari {total}', + 'flightLive.adminTitle': 'Status penerbangan langsung', + 'flightLive.adminHint': + 'Menampilkan posisi, keterlambatan, dan perkiraan kedatangan penerbangan yang dipesan dari data ADS-B terbuka (adsb.lol, adsb.fi). Hanya tanda panggil penerbangan yang keluar dari server ini.', + 'flightLive.adminToggle': 'Ikuti penerbangan yang dipesan secara langsung', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Menampilkan posisi, keterlambatan, dan perkiraan kedatangan penerbangan yang dipesan dari data ADS-B terbuka (adsb.lol). Hanya tanda panggil penerbangan yang keluar dari instans.', + 'flightLive.noFlight': 'Tidak ada penerbangan mendatang', + 'flightLive.envLocked': 'Diatur oleh FLIGHT_LIVE_ENABLED di server dan tidak dapat diubah di sini.', +}; + +export default flightLive; diff --git a/shared/src/i18n/id/index.ts b/shared/src/i18n/id/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/id/index.ts +++ b/shared/src/i18n/id/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/it/flightLive.ts b/shared/src/i18n/it/flightLive.ts new file mode 100644 index 000000000..78b75f7d8 --- /dev/null +++ b/shared/src/i18n/it/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} g {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min in anticipo', + 'flightLive.onTime': 'In orario', + 'flightLive.departsIn': 'Parte tra {time}', + 'flightLive.scheduled': 'Programmato', + 'flightLive.watching': 'TREK è in attesa dell’aereo', + 'flightLive.taxiing': 'Pronto alla partenza', + 'flightLive.atAirport': 'A terra a {code}', + 'flightLive.airborne': 'In volo', + 'flightLive.landsIn': 'Atterra tra {time}', + 'flightLive.landed': 'Atterrato', + 'flightLive.landedAt': 'Atterrato alle {time} a {code}', + 'flightLive.over': 'Volo concluso', + 'flightLive.noSignal': 'Nessun dato in tempo reale', + 'flightLive.noSignalHint': 'La rete aperta dei dati di volo non conosce questo volo con il suo numero.', + 'flightLive.estimated': 'stimato', + 'flightLive.actual': 'effettivo', + 'flightLive.altitude': 'Quota', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Velocità', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Mancano', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Aereo', + 'flightLive.lastSignal': 'Ultimo segnale {time} fa', + 'flightLive.updated': 'Aggiornato {time} fa', + 'flightLive.noGateHint': + 'Gate, terminal e nastro bagagli non fanno parte dei dati di volo aperti. Aggiungili tu alla prenotazione se ti servono.', + 'flightLive.legOf': 'Volo {n} di {total}', + 'flightLive.adminTitle': 'Stato voli in tempo reale', + 'flightLive.adminHint': + 'Mostra posizione, ritardo e arrivo stimato dei voli prenotati da dati ADS-B aperti (adsb.lol, adsb.fi). Solo il nominativo del volo lascia questo server.', + 'flightLive.adminToggle': 'Segui in tempo reale i voli prenotati', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Mostra posizione, ritardo e arrivo stimato dei voli prenotati da dati ADS-B aperti (adsb.lol). Solo il nominativo del volo lascia l’istanza.', + 'flightLive.noFlight': 'Nessun volo in programma', + 'flightLive.envLocked': 'Impostato da FLIGHT_LIVE_ENABLED sul server e non modificabile qui.', +}; + +export default flightLive; diff --git a/shared/src/i18n/it/index.ts b/shared/src/i18n/it/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/it/index.ts +++ b/shared/src/i18n/it/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/ja/flightLive.ts b/shared/src/i18n/ja/flightLive.ts new file mode 100644 index 000000000..1b748d698 --- /dev/null +++ b/shared/src/i18n/ja/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d}日{h}時間', + 'flightLive.durHoursMinutes': '{h}時間{m}分', + 'flightLive.durMinutes': '{m}分', + 'flightLive.late': '+{m}分', + 'flightLive.early': '{m}分早着', + 'flightLive.onTime': '定刻', + 'flightLive.departsIn': '出発まで{time}', + 'flightLive.scheduled': '予定', + 'flightLive.watching': 'TREK が機体を待っています', + 'flightLive.taxiing': '出発準備完了', + 'flightLive.atAirport': '{code} の地上', + 'flightLive.airborne': '飛行中', + 'flightLive.landsIn': '着陸まで{time}', + 'flightLive.landed': '着陸済み', + 'flightLive.landedAt': '{time} に {code} へ着陸', + 'flightLive.over': 'フライト終了', + 'flightLive.noSignal': 'ライブデータなし', + 'flightLive.noSignalHint': 'オープンなフライトデータ網はこの便を便名で把握していません。', + 'flightLive.estimated': '予定', + 'flightLive.actual': '実績', + 'flightLive.altitude': '高度', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': '速度', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': '残り', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': '機体', + 'flightLive.lastSignal': '最終信号 {time}前', + 'flightLive.updated': '{time}前に更新', + 'flightLive.noGateHint': + 'ゲート、ターミナル、手荷物受取所はオープンなフライトデータに含まれません。必要なら予約に自分で追加してください。', + 'flightLive.legOf': 'フライト {n}/{total}', + 'flightLive.adminTitle': 'フライトのライブ状況', + 'flightLive.adminHint': + 'オープンな ADS-B データ(adsb.lol、adsb.fi)から、予約したフライトの位置、遅延、到着予定を表示します。このサーバーから送られるのは便のコールサインだけです。', + 'flightLive.adminToggle': '予約したフライトをライブで追跡', + 'flightLive.headlineDetail': '{headline}、{detail}', + 'flightLive.adminHintManaged': + 'オープンな ADS-B データ(adsb.lol)から、予約したフライトの位置、遅延、到着予定を表示します。インスタンスから送られるのは便のコールサインだけです。', + 'flightLive.noFlight': '予定のフライトはありません', + 'flightLive.envLocked': 'サーバーの FLIGHT_LIVE_ENABLED で設定されているため、ここでは変更できません。', +}; + +export default flightLive; diff --git a/shared/src/i18n/ja/index.ts b/shared/src/i18n/ja/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/ja/index.ts +++ b/shared/src/i18n/ja/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/ko/flightLive.ts b/shared/src/i18n/ko/flightLive.ts new file mode 100644 index 000000000..6202e2028 --- /dev/null +++ b/shared/src/i18n/ko/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d}일 {h}시간', + 'flightLive.durHoursMinutes': '{h}시간 {m}분', + 'flightLive.durMinutes': '{m}분', + 'flightLive.late': '+{m}분', + 'flightLive.early': '{m}분 일찍', + 'flightLive.onTime': '정시', + 'flightLive.departsIn': '{time} 후 출발', + 'flightLive.scheduled': '예정', + 'flightLive.watching': 'TREK이 항공기를 기다리는 중', + 'flightLive.taxiing': '출발 준비 완료', + 'flightLive.atAirport': '{code} 지상', + 'flightLive.airborne': '비행 중', + 'flightLive.landsIn': '{time} 후 착륙', + 'flightLive.landed': '착륙함', + 'flightLive.landedAt': '{time}에 {code} 착륙', + 'flightLive.over': '비행 종료', + 'flightLive.noSignal': '실시간 데이터 없음', + 'flightLive.noSignalHint': '공개 비행 데이터 네트워크가 이 항공편을 편명으로 알지 못합니다.', + 'flightLive.estimated': '예상', + 'flightLive.actual': '실제', + 'flightLive.altitude': '고도', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': '속도', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': '남음', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': '항공기', + 'flightLive.lastSignal': '마지막 신호 {time} 전', + 'flightLive.updated': '{time} 전 업데이트', + 'flightLive.noGateHint': + '게이트, 터미널, 수하물 벨트는 공개 비행 데이터에 없습니다. 필요하면 예약에 직접 추가하세요.', + 'flightLive.legOf': '항공편 {n}/{total}', + 'flightLive.adminTitle': '실시간 항공편 상태', + 'flightLive.adminHint': + '공개 ADS-B 데이터(adsb.lol, adsb.fi)로 예약한 항공편의 위치, 지연, 도착 예정 시각을 보여줍니다. 이 서버에서 나가는 것은 항공편 호출부호뿐입니다.', + 'flightLive.adminToggle': '예약한 항공편 실시간 추적', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + '공개 ADS-B 데이터(adsb.lol)로 예약한 항공편의 위치, 지연, 도착 예정 시각을 보여줍니다. 인스턴스에서 나가는 것은 항공편 호출부호뿐입니다.', + 'flightLive.noFlight': '예정된 항공편 없음', + 'flightLive.envLocked': '서버의 FLIGHT_LIVE_ENABLED로 설정되어 여기서 변경할 수 없습니다.', +}; + +export default flightLive; diff --git a/shared/src/i18n/ko/index.ts b/shared/src/i18n/ko/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/ko/index.ts +++ b/shared/src/i18n/ko/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/nl/flightLive.ts b/shared/src/i18n/nl/flightLive.ts new file mode 100644 index 000000000..6da4c7fdb --- /dev/null +++ b/shared/src/i18n/nl/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} u', + 'flightLive.durHoursMinutes': '{h} u {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min eerder', + 'flightLive.onTime': 'Op tijd', + 'flightLive.departsIn': 'Vertrekt over {time}', + 'flightLive.scheduled': 'Gepland', + 'flightLive.watching': 'TREK let op het toestel', + 'flightLive.taxiing': 'Klaar voor vertrek', + 'flightLive.atAirport': 'Aan de grond in {code}', + 'flightLive.airborne': 'In de lucht', + 'flightLive.landsIn': 'Landt over {time}', + 'flightLive.landed': 'Geland', + 'flightLive.landedAt': 'Om {time} geland in {code}', + 'flightLive.over': 'Vlucht voorbij', + 'flightLive.noSignal': 'Geen livegegevens', + 'flightLive.noSignalHint': 'Het open vluchtdatanetwerk kent deze vlucht niet onder zijn nummer.', + 'flightLive.estimated': 'verwacht', + 'flightLive.actual': 'werkelijk', + 'flightLive.altitude': 'Hoogte', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Snelheid', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/u', + 'flightLive.remaining': 'Resterend', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Toestel', + 'flightLive.lastSignal': 'Laatste signaal {time} geleden', + 'flightLive.updated': '{time} geleden bijgewerkt', + 'flightLive.noGateHint': + 'Gate, terminal en bagageband horen niet bij open vluchtgegevens. Voeg ze zelf aan de boeking toe als je ze nodig hebt.', + 'flightLive.legOf': 'Vlucht {n} van {total}', + 'flightLive.adminTitle': 'Live vluchtstatus', + 'flightLive.adminHint': + 'Toont positie, vertraging en verwachte aankomst van geboekte vluchten uit open ADS-B-gegevens (adsb.lol, adsb.fi). Alleen de roepnaam van de vlucht verlaat deze server.', + 'flightLive.adminToggle': 'Geboekte vluchten live volgen', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Toont positie, vertraging en verwachte aankomst van geboekte vluchten uit open ADS-B-gegevens (adsb.lol). Alleen de roepnaam van de vlucht verlaat de instantie.', + 'flightLive.noFlight': 'Geen vlucht gepland', + 'flightLive.envLocked': 'Ingesteld door FLIGHT_LIVE_ENABLED op de server en hier niet te wijzigen.', +}; + +export default flightLive; diff --git a/shared/src/i18n/nl/index.ts b/shared/src/i18n/nl/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/nl/index.ts +++ b/shared/src/i18n/nl/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/pl/flightLive.ts b/shared/src/i18n/pl/flightLive.ts new file mode 100644 index 000000000..41ff1e36e --- /dev/null +++ b/shared/src/i18n/pl/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} godz.', + 'flightLive.durHoursMinutes': '{h} godz. {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min wcześniej', + 'flightLive.onTime': 'Punktualnie', + 'flightLive.departsIn': 'Odlot za {time}', + 'flightLive.scheduled': 'Planowany', + 'flightLive.watching': 'TREK wypatruje samolotu', + 'flightLive.taxiing': 'Gotowy do odlotu', + 'flightLive.atAirport': 'Na ziemi w {code}', + 'flightLive.airborne': 'W powietrzu', + 'flightLive.landsIn': 'Lądowanie za {time}', + 'flightLive.landed': 'Wylądował', + 'flightLive.landedAt': 'Wylądował o {time} w {code}', + 'flightLive.over': 'Lot zakończony', + 'flightLive.noSignal': 'Brak danych na żywo', + 'flightLive.noSignalHint': 'Otwarta sieć danych lotniczych nie zna tego lotu pod jego numerem.', + 'flightLive.estimated': 'szacowany', + 'flightLive.actual': 'rzeczywisty', + 'flightLive.altitude': 'Wysokość', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Prędkość', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Pozostało', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Samolot', + 'flightLive.lastSignal': 'Ostatni sygnał {time} temu', + 'flightLive.updated': 'Zaktualizowano {time} temu', + 'flightLive.noGateHint': + 'Bramka, terminal i taśma bagażowa nie należą do otwartych danych lotniczych. W razie potrzeby dodaj je sam do rezerwacji.', + 'flightLive.legOf': 'Lot {n} z {total}', + 'flightLive.adminTitle': 'Status lotów na żywo', + 'flightLive.adminHint': + 'Pokazuje pozycję, opóźnienie i przewidywany przylot zarezerwowanych lotów na podstawie otwartych danych ADS-B (adsb.lol, adsb.fi). Serwer opuszcza tylko znak wywoławczy lotu.', + 'flightLive.adminToggle': 'Śledź zarezerwowane loty na żywo', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Pokazuje pozycję, opóźnienie i przewidywany przylot zarezerwowanych lotów na podstawie otwartych danych ADS-B (adsb.lol). Instancję opuszcza tylko znak wywoławczy lotu.', + 'flightLive.noFlight': 'Brak zaplanowanego lotu', + 'flightLive.envLocked': 'Ustawione przez FLIGHT_LIVE_ENABLED na serwerze i nie można tego tutaj zmienić.', +}; + +export default flightLive; diff --git a/shared/src/i18n/pl/index.ts b/shared/src/i18n/pl/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/pl/index.ts +++ b/shared/src/i18n/pl/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/ru/flightLive.ts b/shared/src/i18n/ru/flightLive.ts new file mode 100644 index 000000000..0a41d684a --- /dev/null +++ b/shared/src/i18n/ru/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} д {h} ч', + 'flightLive.durHoursMinutes': '{h} ч {m} мин', + 'flightLive.durMinutes': '{m} мин', + 'flightLive.late': '+{m} мин', + 'flightLive.early': 'на {m} мин раньше', + 'flightLive.onTime': 'Вовремя', + 'flightLive.departsIn': 'Вылет через {time}', + 'flightLive.scheduled': 'По расписанию', + 'flightLive.watching': 'TREK ждёт появления самолёта', + 'flightLive.taxiing': 'Готов к вылету', + 'flightLive.atAirport': 'На земле в {code}', + 'flightLive.airborne': 'В воздухе', + 'flightLive.landsIn': 'Посадка через {time}', + 'flightLive.landed': 'Приземлился', + 'flightLive.landedAt': 'Приземлился в {time} в {code}', + 'flightLive.over': 'Рейс завершён', + 'flightLive.noSignal': 'Нет данных в реальном времени', + 'flightLive.noSignalHint': 'Открытая сеть данных о полётах не знает этот рейс по его номеру.', + 'flightLive.estimated': 'ожидается', + 'flightLive.actual': 'фактически', + 'flightLive.altitude': 'Высота', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} м', + 'flightLive.speed': 'Скорость', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} км/ч', + 'flightLive.remaining': 'Осталось', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} км', + 'flightLive.aircraft': 'Самолёт', + 'flightLive.lastSignal': 'Последний сигнал {time} назад', + 'flightLive.updated': 'Обновлено {time} назад', + 'flightLive.noGateHint': + 'Выход, терминал и лента выдачи багажа не входят в открытые данные о полётах. При необходимости добавьте их в бронирование сами.', + 'flightLive.legOf': 'Рейс {n} из {total}', + 'flightLive.adminTitle': 'Статус рейсов в реальном времени', + 'flightLive.adminHint': + 'Показывает положение, задержку и ожидаемое прибытие забронированных рейсов по открытым данным ADS-B (adsb.lol, adsb.fi). Сервер покидает только позывной рейса.', + 'flightLive.adminToggle': 'Отслеживать забронированные рейсы в реальном времени', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Показывает положение, задержку и ожидаемое прибытие забронированных рейсов по открытым данным ADS-B (adsb.lol). Инстанс покидает только позывной рейса.', + 'flightLive.noFlight': 'Нет предстоящих рейсов', + 'flightLive.envLocked': 'Задано через FLIGHT_LIVE_ENABLED на сервере и здесь не меняется.', +}; + +export default flightLive; diff --git a/shared/src/i18n/ru/index.ts b/shared/src/i18n/ru/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/ru/index.ts +++ b/shared/src/i18n/ru/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/sk/flightLive.ts b/shared/src/i18n/sk/flightLive.ts new file mode 100644 index 000000000..7bff6d22f --- /dev/null +++ b/shared/src/i18n/sk/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': 'o {m} min skôr', + 'flightLive.onTime': 'Načas', + 'flightLive.departsIn': 'Odlet o {time}', + 'flightLive.scheduled': 'Plánovaný', + 'flightLive.watching': 'TREK vyzerá lietadlo', + 'flightLive.taxiing': 'Pripravené na odlet', + 'flightLive.atAirport': 'Na zemi v {code}', + 'flightLive.airborne': 'Vo vzduchu', + 'flightLive.landsIn': 'Pristane o {time}', + 'flightLive.landed': 'Pristálo', + 'flightLive.landedAt': 'Pristálo o {time} v {code}', + 'flightLive.over': 'Let sa skončil', + 'flightLive.noSignal': 'Žiadne živé údaje', + 'flightLive.noSignalHint': 'Otvorená sieť letových údajov tento let pod jeho číslom nepozná.', + 'flightLive.estimated': 'odhad', + 'flightLive.actual': 'skutočnosť', + 'flightLive.altitude': 'Výška', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Rýchlosť', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Zostáva', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Lietadlo', + 'flightLive.lastSignal': 'Posledný signál pred {time}', + 'flightLive.updated': 'Aktualizované pred {time}', + 'flightLive.noGateHint': + 'Brána, terminál a pás batožiny nie sú súčasťou otvorených letových údajov. Ak ich potrebuješ, doplň ich do rezervácie sám.', + 'flightLive.legOf': 'Let {n} z {total}', + 'flightLive.adminTitle': 'Živý stav letov', + 'flightLive.adminHint': + 'Zobrazuje polohu, meškanie a odhadovaný prílet rezervovaných letov z otvorených údajov ADS-B (adsb.lol, adsb.fi). Server opúšťa len volací znak letu.', + 'flightLive.adminToggle': 'Sledovať rezervované lety naživo', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Zobrazuje polohu, meškanie a odhadovaný prílet rezervovaných letov z otvorených údajov ADS-B (adsb.lol). Inštanciu opúšťa len volací znak letu.', + 'flightLive.noFlight': 'Žiadny naplánovaný let', + 'flightLive.envLocked': 'Nastavené cez FLIGHT_LIVE_ENABLED na serveri, tu sa to nedá zmeniť.', +}; + +export default flightLive; diff --git a/shared/src/i18n/sk/index.ts b/shared/src/i18n/sk/index.ts index 1a0ff1d80..bb9ce471c 100644 --- a/shared/src/i18n/sk/index.ts +++ b/shared/src/i18n/sk/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/sv/flightLive.ts b/shared/src/i18n/sv/flightLive.ts new file mode 100644 index 000000000..2dae463fe --- /dev/null +++ b/shared/src/i18n/sv/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} d {h} h', + 'flightLive.durHoursMinutes': '{h} h {m} min', + 'flightLive.durMinutes': '{m} min', + 'flightLive.late': '+{m} min', + 'flightLive.early': '{m} min tidigt', + 'flightLive.onTime': 'I tid', + 'flightLive.departsIn': 'Avgår om {time}', + 'flightLive.scheduled': 'Planerad', + 'flightLive.watching': 'TREK håller utkik efter planet', + 'flightLive.taxiing': 'Redo för avgång', + 'flightLive.atAirport': 'På marken i {code}', + 'flightLive.airborne': 'I luften', + 'flightLive.landsIn': 'Landar om {time}', + 'flightLive.landed': 'Landat', + 'flightLive.landedAt': 'Landade {time} i {code}', + 'flightLive.over': 'Flygningen är över', + 'flightLive.noSignal': 'Ingen livedata', + 'flightLive.noSignalHint': 'Det öppna flygdatanätet känner inte till den här flygningen under dess nummer.', + 'flightLive.estimated': 'beräknad', + 'flightLive.actual': 'faktisk', + 'flightLive.altitude': 'Höjd', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Hastighet', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Kvar', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Flygplan', + 'flightLive.lastSignal': 'Senaste signal för {time} sedan', + 'flightLive.updated': 'Uppdaterad för {time} sedan', + 'flightLive.noGateHint': + 'Gate, terminal och bagageband ingår inte i öppna flygdata. Lägg till dem i bokningen själv om du behöver dem.', + 'flightLive.legOf': 'Flyg {n} av {total}', + 'flightLive.adminTitle': 'Flygstatus live', + 'flightLive.adminHint': + 'Visar position, försening och beräknad ankomst för bokade flyg från öppna ADS-B-data (adsb.lol, adsb.fi). Endast flygets anropssignal lämnar den här servern.', + 'flightLive.adminToggle': 'Följ bokade flyg live', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Visar position, försening och beräknad ankomst för bokade flyg från öppna ADS-B-data (adsb.lol). Endast flygets anropssignal lämnar instansen.', + 'flightLive.noFlight': 'Inget flyg planerat', + 'flightLive.envLocked': 'Inställt med FLIGHT_LIVE_ENABLED på servern och kan inte ändras här.', +}; + +export default flightLive; diff --git a/shared/src/i18n/sv/index.ts b/shared/src/i18n/sv/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/sv/index.ts +++ b/shared/src/i18n/sv/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/th/flightLive.ts b/shared/src/i18n/th/flightLive.ts new file mode 100644 index 000000000..4a0b4022a --- /dev/null +++ b/shared/src/i18n/th/flightLive.ts @@ -0,0 +1,49 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} วัน {h} ชม.', + 'flightLive.durHoursMinutes': '{h} ชม. {m} นาที', + 'flightLive.durMinutes': '{m} นาที', + 'flightLive.late': '+{m} นาที', + 'flightLive.early': 'เร็วกว่า {m} นาที', + 'flightLive.onTime': 'ตรงเวลา', + 'flightLive.departsIn': 'ออกเดินทางในอีก {time}', + 'flightLive.scheduled': 'ตามกำหนด', + 'flightLive.watching': 'TREK กำลังรอเครื่องบิน', + 'flightLive.taxiing': 'พร้อมออกเดินทาง', + 'flightLive.atAirport': 'อยู่บนพื้นที่ {code}', + 'flightLive.airborne': 'อยู่บนฟ้า', + 'flightLive.landsIn': 'ลงจอดในอีก {time}', + 'flightLive.landed': 'ลงจอดแล้ว', + 'flightLive.landedAt': 'ลงจอดเวลา {time} ที่ {code}', + 'flightLive.over': 'เที่ยวบินจบแล้ว', + 'flightLive.noSignal': 'ไม่มีข้อมูลสด', + 'flightLive.noSignalHint': 'เครือข่ายข้อมูลการบินแบบเปิดไม่รู้จักเที่ยวบินนี้จากหมายเลข', + 'flightLive.estimated': 'โดยประมาณ', + 'flightLive.actual': 'จริง', + 'flightLive.altitude': 'ความสูง', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} ม.', + 'flightLive.speed': 'ความเร็ว', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} กม./ชม.', + 'flightLive.remaining': 'เหลือ', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} กม.', + 'flightLive.aircraft': 'เครื่องบิน', + 'flightLive.lastSignal': 'สัญญาณล่าสุดเมื่อ {time} ที่แล้ว', + 'flightLive.updated': 'อัปเดตเมื่อ {time} ที่แล้ว', + 'flightLive.noGateHint': 'ประตู อาคาร และสายพานกระเป๋าไม่อยู่ในข้อมูลการบินแบบเปิด เพิ่มเองในการจองหากต้องการ', + 'flightLive.legOf': 'เที่ยวบิน {n} จาก {total}', + 'flightLive.adminTitle': 'สถานะเที่ยวบินสด', + 'flightLive.adminHint': + 'แสดงตำแหน่ง ความล่าช้า และเวลาถึงโดยประมาณของเที่ยวบินที่จองจากข้อมูล ADS-B แบบเปิด (adsb.lol, adsb.fi) มีเพียงสัญญาณเรียกขานของเที่ยวบินเท่านั้นที่ออกจากเซิร์ฟเวอร์นี้', + 'flightLive.adminToggle': 'ติดตามเที่ยวบินที่จองแบบสด', + 'flightLive.headlineDetail': '{headline} {detail}', + 'flightLive.adminHintManaged': + 'แสดงตำแหน่ง ความล่าช้า และเวลาถึงโดยประมาณของเที่ยวบินที่จองจากข้อมูล ADS-B แบบเปิด (adsb.lol) มีเพียงสัญญาณเรียกขานของเที่ยวบินเท่านั้นที่ออกจากอินสแตนซ์', + 'flightLive.noFlight': 'ไม่มีเที่ยวบินที่กำลังจะมาถึง', + 'flightLive.envLocked': 'ตั้งค่าโดย FLIGHT_LIVE_ENABLED บนเซิร์ฟเวอร์และเปลี่ยนที่นี่ไม่ได้', +}; + +export default flightLive; diff --git a/shared/src/i18n/th/index.ts b/shared/src/i18n/th/index.ts index 1a0ff1d80..bb9ce471c 100644 --- a/shared/src/i18n/th/index.ts +++ b/shared/src/i18n/th/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/tr/flightLive.ts b/shared/src/i18n/tr/flightLive.ts new file mode 100644 index 000000000..ce542447b --- /dev/null +++ b/shared/src/i18n/tr/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} g {h} sa', + 'flightLive.durHoursMinutes': '{h} sa {m} dk', + 'flightLive.durMinutes': '{m} dk', + 'flightLive.late': '+{m} dk', + 'flightLive.early': '{m} dk erken', + 'flightLive.onTime': 'Zamanında', + 'flightLive.departsIn': '{time} sonra kalkış', + 'flightLive.scheduled': 'Planlandı', + 'flightLive.watching': 'TREK uçağı gözlüyor', + 'flightLive.taxiing': 'Kalkışa hazır', + 'flightLive.atAirport': '{code} yerde', + 'flightLive.airborne': 'Havada', + 'flightLive.landsIn': '{time} sonra iniş', + 'flightLive.landed': 'İndi', + 'flightLive.landedAt': '{time} saatinde {code} indi', + 'flightLive.over': 'Uçuş bitti', + 'flightLive.noSignal': 'Canlı veri yok', + 'flightLive.noSignalHint': 'Açık uçuş veri ağı bu uçuşu numarasıyla tanımıyor.', + 'flightLive.estimated': 'tahmini', + 'flightLive.actual': 'gerçek', + 'flightLive.altitude': 'İrtifa', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Hız', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/sa', + 'flightLive.remaining': 'Kalan', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Uçak', + 'flightLive.lastSignal': 'Son sinyal {time} önce', + 'flightLive.updated': '{time} önce güncellendi', + 'flightLive.noGateHint': + 'Kapı, terminal ve bagaj bandı açık uçuş verilerinde yer almaz. Gerekirse bunları rezervasyona kendin ekle.', + 'flightLive.legOf': 'Uçuş {n}/{total}', + 'flightLive.adminTitle': 'Canlı uçuş durumu', + 'flightLive.adminHint': + 'Açık ADS-B verilerinden (adsb.lol, adsb.fi) rezerve edilen uçuşların konumunu, gecikmesini ve tahmini varışını gösterir. Bu sunucudan yalnızca uçuşun çağrı kodu çıkar.', + 'flightLive.adminToggle': 'Rezerve edilen uçuşları canlı izle', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Açık ADS-B verilerinden (adsb.lol) rezerve edilen uçuşların konumunu, gecikmesini ve tahmini varışını gösterir. Örnekten yalnızca uçuşun çağrı kodu çıkar.', + 'flightLive.noFlight': 'Yaklaşan uçuş yok', + 'flightLive.envLocked': 'Sunucuda FLIGHT_LIVE_ENABLED ile ayarlanır, burada değiştirilemez.', +}; + +export default flightLive; diff --git a/shared/src/i18n/tr/index.ts b/shared/src/i18n/tr/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/tr/index.ts +++ b/shared/src/i18n/tr/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/uk/flightLive.ts b/shared/src/i18n/uk/flightLive.ts new file mode 100644 index 000000000..601fe155c --- /dev/null +++ b/shared/src/i18n/uk/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} д {h} год', + 'flightLive.durHoursMinutes': '{h} год {m} хв', + 'flightLive.durMinutes': '{m} хв', + 'flightLive.late': '+{m} хв', + 'flightLive.early': 'на {m} хв раніше', + 'flightLive.onTime': 'Вчасно', + 'flightLive.departsIn': 'Виліт через {time}', + 'flightLive.scheduled': 'За розкладом', + 'flightLive.watching': 'TREK чекає на появу літака', + 'flightLive.taxiing': 'Готовий до вильоту', + 'flightLive.atAirport': 'На землі в {code}', + 'flightLive.airborne': 'У повітрі', + 'flightLive.landsIn': 'Посадка через {time}', + 'flightLive.landed': 'Приземлився', + 'flightLive.landedAt': 'Приземлився о {time} в {code}', + 'flightLive.over': 'Рейс завершено', + 'flightLive.noSignal': 'Немає даних у реальному часі', + 'flightLive.noSignalHint': 'Відкрита мережа даних про польоти не знає цей рейс за його номером.', + 'flightLive.estimated': 'очікується', + 'flightLive.actual': 'фактично', + 'flightLive.altitude': 'Висота', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} м', + 'flightLive.speed': 'Швидкість', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} км/год', + 'flightLive.remaining': 'Залишилось', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} км', + 'flightLive.aircraft': 'Літак', + 'flightLive.lastSignal': 'Останній сигнал {time} тому', + 'flightLive.updated': 'Оновлено {time} тому', + 'flightLive.noGateHint': + 'Вихід, термінал і стрічка видачі багажу не входять до відкритих даних про польоти. За потреби додайте їх до бронювання самі.', + 'flightLive.legOf': 'Рейс {n} з {total}', + 'flightLive.adminTitle': 'Статус рейсів у реальному часі', + 'flightLive.adminHint': + 'Показує положення, затримку й очікуване прибуття заброньованих рейсів за відкритими даними ADS-B (adsb.lol, adsb.fi). Сервер залишає лише позивний рейсу.', + 'flightLive.adminToggle': 'Відстежувати заброньовані рейси наживо', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Показує положення, затримку й очікуване прибуття заброньованих рейсів за відкритими даними ADS-B (adsb.lol). Інстанс залишає лише позивний рейсу.', + 'flightLive.noFlight': 'Немає запланованих рейсів', + 'flightLive.envLocked': 'Задано через FLIGHT_LIVE_ENABLED на сервері, тут змінити не можна.', +}; + +export default flightLive; diff --git a/shared/src/i18n/uk/index.ts b/shared/src/i18n/uk/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/uk/index.ts +++ b/shared/src/i18n/uk/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/vi/flightLive.ts b/shared/src/i18n/vi/flightLive.ts new file mode 100644 index 000000000..f332cbe18 --- /dev/null +++ b/shared/src/i18n/vi/flightLive.ts @@ -0,0 +1,50 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d} ng {h} g', + 'flightLive.durHoursMinutes': '{h} g {m} ph', + 'flightLive.durMinutes': '{m} ph', + 'flightLive.late': '+{m} ph', + 'flightLive.early': 'sớm {m} ph', + 'flightLive.onTime': 'Đúng giờ', + 'flightLive.departsIn': 'Khởi hành sau {time}', + 'flightLive.scheduled': 'Theo lịch', + 'flightLive.watching': 'TREK đang chờ máy bay xuất hiện', + 'flightLive.taxiing': 'Sẵn sàng khởi hành', + 'flightLive.atAirport': 'Trên mặt đất tại {code}', + 'flightLive.airborne': 'Đang bay', + 'flightLive.landsIn': 'Hạ cánh sau {time}', + 'flightLive.landed': 'Đã hạ cánh', + 'flightLive.landedAt': 'Hạ cánh lúc {time} tại {code}', + 'flightLive.over': 'Chuyến bay đã kết thúc', + 'flightLive.noSignal': 'Không có dữ liệu trực tiếp', + 'flightLive.noSignalHint': 'Mạng dữ liệu chuyến bay mở không biết chuyến bay này theo số hiệu.', + 'flightLive.estimated': 'dự kiến', + 'flightLive.actual': 'thực tế', + 'flightLive.altitude': 'Độ cao', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} m', + 'flightLive.speed': 'Tốc độ', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} km/h', + 'flightLive.remaining': 'Còn lại', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} km', + 'flightLive.aircraft': 'Máy bay', + 'flightLive.lastSignal': 'Tín hiệu cuối {time} trước', + 'flightLive.updated': 'Cập nhật {time} trước', + 'flightLive.noGateHint': + 'Cửa, nhà ga và băng chuyền hành lý không có trong dữ liệu chuyến bay mở. Hãy tự thêm vào đặt chỗ nếu cần.', + 'flightLive.legOf': 'Chuyến {n}/{total}', + 'flightLive.adminTitle': 'Trạng thái chuyến bay trực tiếp', + 'flightLive.adminHint': + 'Hiển thị vị trí, độ trễ và giờ đến dự kiến của các chuyến bay đã đặt từ dữ liệu ADS-B mở (adsb.lol, adsb.fi). Chỉ có hô hiệu chuyến bay rời khỏi máy chủ này.', + 'flightLive.adminToggle': 'Theo dõi trực tiếp các chuyến bay đã đặt', + 'flightLive.headlineDetail': '{headline}, {detail}', + 'flightLive.adminHintManaged': + 'Hiển thị vị trí, độ trễ và giờ đến dự kiến của các chuyến bay đã đặt từ dữ liệu ADS-B mở (adsb.lol). Chỉ có hô hiệu chuyến bay rời khỏi phiên bản.', + 'flightLive.noFlight': 'Không có chuyến bay sắp tới', + 'flightLive.envLocked': 'Được đặt bởi FLIGHT_LIVE_ENABLED trên máy chủ và không thể thay đổi ở đây.', +}; + +export default flightLive; diff --git a/shared/src/i18n/vi/index.ts b/shared/src/i18n/vi/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/vi/index.ts +++ b/shared/src/i18n/vi/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/zh-TW/flightLive.ts b/shared/src/i18n/zh-TW/flightLive.ts new file mode 100644 index 000000000..1a0d8a05c --- /dev/null +++ b/shared/src/i18n/zh-TW/flightLive.ts @@ -0,0 +1,49 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d}天{h}小時', + 'flightLive.durHoursMinutes': '{h}小時{m}分', + 'flightLive.durMinutes': '{m}分', + 'flightLive.late': '+{m}分', + 'flightLive.early': '提早{m}分', + 'flightLive.onTime': '準點', + 'flightLive.departsIn': '{time}後起飛', + 'flightLive.scheduled': '預定', + 'flightLive.watching': 'TREK 正在等候飛機出現', + 'flightLive.taxiing': '準備起飛', + 'flightLive.atAirport': '在 {code} 地面', + 'flightLive.airborne': '飛行中', + 'flightLive.landsIn': '{time}後降落', + 'flightLive.landed': '已降落', + 'flightLive.landedAt': '{time} 降落於 {code}', + 'flightLive.over': '航班已結束', + 'flightLive.noSignal': '無即時資料', + 'flightLive.noSignalHint': '開放航班資料網路無法依航班號辨識此航班。', + 'flightLive.estimated': '預計', + 'flightLive.actual': '實際', + 'flightLive.altitude': '高度', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} 公尺', + 'flightLive.speed': '速度', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} 公里/小時', + 'flightLive.remaining': '剩餘', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} 公里', + 'flightLive.aircraft': '飛機', + 'flightLive.lastSignal': '最後訊號 {time}前', + 'flightLive.updated': '{time}前更新', + 'flightLive.noGateHint': '登機門、航廈和行李轉盤不屬於開放航班資料。如有需要,請自行加入訂位。', + 'flightLive.legOf': '第 {n} 段,共 {total} 段', + 'flightLive.adminTitle': '即時航班狀態', + 'flightLive.adminHint': + '依據開放 ADS-B 資料(adsb.lol、adsb.fi)顯示已預訂航班的位置、延誤和預計抵達時間。只有航班呼號會離開此伺服器。', + 'flightLive.adminToggle': '即時追蹤已預訂的航班', + 'flightLive.headlineDetail': '{headline},{detail}', + 'flightLive.adminHintManaged': + '依據開放 ADS-B 資料(adsb.lol)顯示已預訂航班的位置、延誤和預計抵達時間。只有航班呼號會離開執行個體。', + 'flightLive.noFlight': '沒有即將到來的航班', + 'flightLive.envLocked': '由伺服器上的 FLIGHT_LIVE_ENABLED 設定,無法在此變更。', +}; + +export default flightLive; diff --git a/shared/src/i18n/zh-TW/index.ts b/shared/src/i18n/zh-TW/index.ts index 5a69724d7..4ca140941 100644 --- a/shared/src/i18n/zh-TW/index.ts +++ b/shared/src/i18n/zh-TW/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour, diff --git a/shared/src/i18n/zh/flightLive.ts b/shared/src/i18n/zh/flightLive.ts new file mode 100644 index 000000000..d22206a24 --- /dev/null +++ b/shared/src/i18n/zh/flightLive.ts @@ -0,0 +1,49 @@ +import type { TranslationStrings } from '../types'; + +const flightLive: TranslationStrings = { + 'flightLive.durDaysHours': '{d}天{h}小时', + 'flightLive.durHoursMinutes': '{h}小时{m}分', + 'flightLive.durMinutes': '{m}分', + 'flightLive.late': '+{m}分', + 'flightLive.early': '提前{m}分', + 'flightLive.onTime': '准点', + 'flightLive.departsIn': '{time}后起飞', + 'flightLive.scheduled': '计划中', + 'flightLive.watching': 'TREK 正在等待飞机出现', + 'flightLive.taxiing': '准备起飞', + 'flightLive.atAirport': '在 {code} 地面', + 'flightLive.airborne': '飞行中', + 'flightLive.landsIn': '{time}后降落', + 'flightLive.landed': '已降落', + 'flightLive.landedAt': '{time} 降落于 {code}', + 'flightLive.over': '航班已结束', + 'flightLive.noSignal': '无实时数据', + 'flightLive.noSignalHint': '开放航班数据网络无法按航班号识别此航班。', + 'flightLive.estimated': '预计', + 'flightLive.actual': '实际', + 'flightLive.altitude': '高度', + 'flightLive.feet': '{n} ft', + 'flightLive.meters': '{n} 米', + 'flightLive.speed': '速度', + 'flightLive.mph': '{n} mph', + 'flightLive.kmh': '{n} 公里/小时', + 'flightLive.remaining': '剩余', + 'flightLive.mi': '{n} mi', + 'flightLive.km': '{n} 公里', + 'flightLive.aircraft': '飞机', + 'flightLive.lastSignal': '最后信号 {time}前', + 'flightLive.updated': '{time}前更新', + 'flightLive.noGateHint': '登机口、航站楼和行李转盘不属于开放航班数据。如有需要,请自行添加到预订中。', + 'flightLive.legOf': '第 {n} 段,共 {total} 段', + 'flightLive.adminTitle': '实时航班状态', + 'flightLive.adminHint': + '根据开放 ADS-B 数据(adsb.lol、adsb.fi)显示已预订航班的位置、延误和预计到达时间。只有航班呼号会离开此服务器。', + 'flightLive.adminToggle': '实时跟踪已预订的航班', + 'flightLive.headlineDetail': '{headline},{detail}', + 'flightLive.adminHintManaged': + '根据开放 ADS-B 数据(adsb.lol)显示已预订航班的位置、延误和预计到达时间。只有航班呼号会离开实例。', + 'flightLive.noFlight': '没有即将到来的航班', + 'flightLive.envLocked': '由服务器上的 FLIGHT_LIVE_ENABLED 设定,无法在此更改。', +}; + +export default flightLive; diff --git a/shared/src/i18n/zh/index.ts b/shared/src/i18n/zh/index.ts index 403813aa6..50591f7a7 100644 --- a/shared/src/i18n/zh/index.ts +++ b/shared/src/i18n/zh/index.ts @@ -31,6 +31,7 @@ import demo from './demo'; import docsync from './docsync'; import ferratas from './ferratas'; import files from './files'; +import flightLive from './flightLive'; import help from './help'; import inspector from './inspector'; import journey from './journey'; @@ -152,6 +153,7 @@ const locale = { ...dawarich, ...docsync, ...ferratas, + ...flightLive, ...assistant, ...assistantCard, ...assistantTour,