diff --git a/src/features/online-board/components/FullRouteTimeline/Timeline.tsx b/src/features/online-board/components/FullRouteTimeline/Timeline.tsx index d8f79583..543cff0f 100644 --- a/src/features/online-board/components/FullRouteTimeline/Timeline.tsx +++ b/src/features/online-board/components/FullRouteTimeline/Timeline.tsx @@ -1,4 +1,5 @@ import { type FC, useState } from "react"; +import { useTranslation } from "@/i18n/provider.js"; import type { IFlightLeg } from "../../types.js"; import { Station } from "./Station.js"; import { StationChange } from "./StationChange.js"; @@ -46,6 +47,7 @@ const Section: FC = ({ legNumber, duration, specifying }) => ( ); export const Timeline: FC = ({ legs, canChange }) => { + const { t } = useTranslation(); const [index, setIndex] = useState(0); const lastPairStart = Math.max(0, legs.length - 2); const currentLeg = legs[index]; @@ -61,7 +63,7 @@ export const Timeline: FC = ({ legs, canChange }) => { className="timeline__arrow" data-testid="timeline-prev" onClick={() => setIndex((i) => Math.max(0, i - 1))} - aria-label="Previous legs" + aria-label={t("SHARED.A11Y-PREV-LEGS")} > {"\u2039"} @@ -98,7 +100,7 @@ export const Timeline: FC = ({ legs, canChange }) => { className="timeline__arrow" data-testid="timeline-next" onClick={() => setIndex((i) => Math.min(lastPairStart, i + 1))} - aria-label="Next legs" + aria-label={t("SHARED.A11Y-NEXT-LEGS")} > {"\u203a"} diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index fad32e0e..776df6e6 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "Bitte beachten Sie:", diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index c3f6437b..4ffd86b1 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -411,7 +411,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "Please note:", diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index 3084675f..44aca259 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "Nota:", diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index e22cffd6..8731a437 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "Remarque:", diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index a36ddf5b..c1d99011 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "Attenzione:", diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index cea1c50b..c33c2a96 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "ご注意:", diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index c8e8b385..46152c0e 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "참고:", diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index 713b3a52..60f88e7c 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -411,7 +411,12 @@ "A11Y-NEXT-PAGE": "Следующая страница", "A11Y-LOADING-FLIGHTS": "Загрузка рейсов", "A11Y-SCROLL-TO-TOP": "Наверх", - "A11Y-PRINT-BTN": "Печать" + "A11Y-PRINT-BTN": "Печать", + "A11Y-CLEAR": "Очистить", + "A11Y-OPEN-PICKER": "Открыть список городов", + "A11Y-BREADCRUMB": "Навигационная цепочка", + "A11Y-PREV-LEGS": "Предыдущие сегменты", + "A11Y-NEXT-LEGS": "Следующие сегменты" }, "SMOKE": { "HEADING": "Страница проверки" diff --git a/src/i18n/locales/zh/common.json b/src/i18n/locales/zh/common.json index e94c0e52..e01ad007 100644 --- a/src/i18n/locales/zh/common.json +++ b/src/i18n/locales/zh/common.json @@ -384,7 +384,12 @@ "A11Y-NEXT-PAGE": "Next page", "A11Y-LOADING-FLIGHTS": "Loading flights", "A11Y-SCROLL-TO-TOP": "Scroll to top", - "A11Y-PRINT-BTN": "Print" + "A11Y-PRINT-BTN": "Print", + "A11Y-CLEAR": "Clear", + "A11Y-OPEN-PICKER": "Open city picker", + "A11Y-BREADCRUMB": "Breadcrumb", + "A11Y-PREV-LEGS": "Previous legs", + "A11Y-NEXT-LEGS": "Next legs" }, "WARNING": { "IFLY_HIGHLIGHT": "请注意:", diff --git a/src/ui/city-autocomplete/CityAutocomplete.tsx b/src/ui/city-autocomplete/CityAutocomplete.tsx index 3d001a3f..1e79066f 100644 --- a/src/ui/city-autocomplete/CityAutocomplete.tsx +++ b/src/ui/city-autocomplete/CityAutocomplete.tsx @@ -1,5 +1,6 @@ import { useState, useRef, useCallback, useEffect, type FC } from "react"; import { AutoComplete, type AutoCompleteCompleteEvent } from "primereact/autocomplete"; +import { useTranslation } from "@/i18n/provider.js"; import { CityPickerPopup } from "./CityPickerPopup.js"; import { searchCities, type CityAutocompleteItem } from "./searchCities.js"; import type { IDictionaries } from "@/shared/dictionaries/index.js"; @@ -26,6 +27,7 @@ export const CityAutocomplete: FC = ({ error, testIdPrefix = "city-autocomplete", }) => { + const { t } = useTranslation(); const [inputValue, setInputValue] = useState(value); const [suggestions, setSuggestions] = useState([]); const [popupOpen, setPopupOpen] = useState(false); @@ -169,7 +171,7 @@ export const CityAutocomplete: FC = ({ className="button-clear" onClick={handleClear} data-testid={`${testIdPrefix}-clear-button`} - aria-label="clear" + aria-label={t("SHARED.A11Y-CLEAR")} />