Translate remaining raw status labels
- ScheduleDetailsPage flight status: rendered raw `flight.status` (English enum 'Scheduled'); now routes through FLIGHT-STATUSES.* keys for localized Russian labels. - FlightsMiniListItem status icon aria-label: same fix, so screen readers say 'Запланирован' instead of 'Scheduled'.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
import { forwardRef } from "react";
|
||||
import { Link } from "@modern-js/runtime/router";
|
||||
import { useTranslation } from "@/i18n/provider.js";
|
||||
import type { ISimpleFlight, IFlightLeg } from "../../types.js";
|
||||
import { buildOnlineBoardUrl } from "../../url.js";
|
||||
import "./FlightsMiniList.scss";
|
||||
@@ -40,6 +41,7 @@ function getArrTime(arr: IFlightLeg["arrival"]): string {
|
||||
|
||||
export const FlightsMiniListItem = forwardRef<HTMLAnchorElement, FlightsMiniListItemProps>(
|
||||
({ flight, isSelected, lang }, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const { dep, arr } = getEndpoints(flight);
|
||||
const href = `/${lang}/${buildOnlineBoardUrl({
|
||||
type: "details",
|
||||
@@ -63,7 +65,10 @@ export const FlightsMiniListItem = forwardRef<HTMLAnchorElement, FlightsMiniList
|
||||
</div>
|
||||
<div className="mini-list__content">
|
||||
<span className="mini-list__dep-time">{getDepTime(dep)}</span>
|
||||
<span className="mini-list__status-icon" aria-label={flight.status}>
|
||||
<span
|
||||
className="mini-list__status-icon"
|
||||
aria-label={t(`FLIGHT-STATUSES.${flight.status}`)}
|
||||
>
|
||||
{"\u2708"}
|
||||
</span>
|
||||
<span className="mini-list__arr-time">{getArrTime(arr)}</span>
|
||||
|
||||
@@ -146,7 +146,9 @@ export const ScheduleDetailsPage: FC<ScheduleDetailsPageProps> = ({
|
||||
|
||||
<div className="schedule-details__header">
|
||||
<h2 className="schedule-details__flight-number">{flightNumber}</h2>
|
||||
<span className="schedule-details__status">{flight.status}</span>
|
||||
<span className="schedule-details__status">
|
||||
{t(`FLIGHT-STATUSES.${flight.status}`)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<FlightCard flight={flight} />
|
||||
|
||||
Reference in New Issue
Block a user