This is an automated email from the ASF dual-hosted git repository. pierrejeambrun pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new 953378b044e Fix missing translations (#52670) 953378b044e is described below commit 953378b044e79f75c11f485b83913cb7825bd2c8 Author: Brent Bovenzi <br...@astronomer.io> AuthorDate: Wed Jul 2 05:04:58 2025 -0400 Fix missing translations (#52670) --- .../src/airflow/ui/public/i18n/locales/ar/dag.json | 14 ++++++-------- .../src/airflow/ui/public/i18n/locales/de/dag.json | 14 ++++++-------- .../airflow/ui/public/i18n/locales/en/common.json | 1 + .../ui/public/i18n/locales/en/components.json | 3 +++ .../src/airflow/ui/public/i18n/locales/en/dag.json | 21 ++++++++++++--------- .../src/airflow/ui/public/i18n/locales/fr/dag.json | 14 ++++++-------- .../src/airflow/ui/public/i18n/locales/he/dag.json | 14 ++++++-------- .../src/airflow/ui/public/i18n/locales/ko/dag.json | 14 ++++++-------- .../src/airflow/ui/public/i18n/locales/pl/dag.json | 14 ++++++-------- .../airflow/ui/public/i18n/locales/zh-TW/dag.json | 14 ++++++-------- .../src/components/DagActions/RunBackfillForm.tsx | 2 +- .../ui/src/constants/reprocessBehaviourParams.ts | 6 +++--- .../ui/src/pages/Dag/Backfills/Backfills.tsx | 10 +++++----- .../pages/GroupTaskInstance/GroupTaskInstance.tsx | 5 +++-- .../ui/src/pages/GroupTaskInstance/Header.tsx | 10 ++++++---- .../ui/src/pages/MappedTaskInstance/Header.tsx | 15 +++++++++++---- .../pages/MappedTaskInstance/MappedTaskInstance.tsx | 7 +++++-- .../src/pages/TaskInstance/Logs/TaskLogHeader.tsx | 16 +++++++++------- airflow-core/src/airflow/ui/src/utils/logs.ts | 12 ++++++------ 19 files changed, 107 insertions(+), 99 deletions(-) diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ar/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/ar/dag.json index ab0354d2373..5bca291459c 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/ar/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/ar/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "جميع مستويات السجل", + "allSources": "جميع المصادر", + "fullscreen": { + "button": "ملء الشاشة", + "tooltip": "اضغط على {{hotkey}} للدخول إلى وضع ملء الشاشة" + }, "noTryNumber": "لا يوجد رقم محاولة", "viewInExternal": "عرض السجلات في {{name}} (المحاولة {{attempt}})" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "طي جميع مجموعات المهام", "expandAll": "توسيع جميع مجموعات المهام" - }, - "taskLogs": { - "allLogLevels": "جميع مستويات السجل", - "allSources": "جميع المصادر", - "fullscreen": { - "button": "ملء الشاشة", - "tooltip": "اضغط على {{hotkey}} للدخول إلى وضع ملء الشاشة" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/de/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/de/dag.json index 8a2968922bc..3a6a8ce3104 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/de/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/de/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "Alle Protokoll-Stufen", + "allSources": "Alle Quellen", + "fullscreen": { + "button": "Vollbild", + "tooltip": "Taste {{hotkey}} für Vollbildmodus" + }, "noTryNumber": "Keine Versuchsnummer", "viewInExternal": "Protokoll in {{name}} (Versuch {{attempt}}) ansehen" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "Alle Task-Gruppen einklappen", "expandAll": "Alle Task-Gruppen aufklappen" - }, - "taskLogs": { - "allLogLevels": "Alle Protokoll-Stufen", - "allSources": "Alle Quellen", - "fullscreen": { - "button": "Vollbild", - "tooltip": "Taste {{hotkey}} für Vollbildmodus" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json index abfb36caba8..9e0b78500f6 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json @@ -270,6 +270,7 @@ } } }, + "total": "Total {{state}}", "triggered": "Triggered", "tryNumber": "Try Number", "user": "User", diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json index 1db16d00dca..dff01bc665c 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/components.json @@ -3,12 +3,15 @@ "affected_one": "1 run will be triggered.", "affected_other": "{{count}} runs will be triggered.", "affectedNone": "No runs matching selected criteria.", + "allRuns": "All Runs", "backwards": "Run Backwards", "dateRange": "Date Range", "dateRangeFrom": "From", "dateRangeTo": "To", "errorStartDateBeforeEndDate": "Start Date must be before the End Date", "maxRuns": "Max Active Runs", + "missingAndErroredRuns": "Missing and Errored Runs", + "missingRuns": "Missing Runs", "reprocessBehavior": "Reprocess Behavior", "run": "Run Backfill", "selectDescription": "Run this Dag for a range of dates", diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json index 314a6861dbd..92b8e59496c 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json @@ -23,8 +23,19 @@ } }, "logs": { + "allLevels": "All Log Levels", + "allSources": "All Sources", + "critical": "CRITICAL", + "debug": "DEBUG", + "error": "ERROR", + "fullscreen": { + "button": "Full screen", + "tooltip": "Press {{hotkey}} for fullscreen" + }, + "info": "INFO", "noTryNumber": "No try number", - "viewInExternal": "View logs in {{name}} (attempt {{attempt}})" + "viewInExternal": "View logs in {{name}} (attempt {{attempt}})", + "warning": "WARNING" }, "overview": { "buttons": { @@ -98,13 +109,5 @@ "taskGroups": { "collapseAll": "Collapse all task groups", "expandAll": "Expand all task groups" - }, - "taskLogs": { - "allLogLevels": "All Log Levels", - "allSources": "All Sources", - "fullscreen": { - "button": "Full screen", - "tooltip": "Press {{hotkey}} for fullscreen" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/fr/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/fr/dag.json index 5b23cc8a86b..4dbf66eb3dd 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/fr/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/fr/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "Tous les niveaux de journalisation", + "allSources": "Toutes les sources", + "fullscreen": { + "button": "Plein écran", + "tooltip": "Appuyez sur {{hotkey}} pour le plein écran" + }, "noTryNumber": "Aucun essai", "viewInExternal": "Voir les journaux dans {{name}} (tentative {{attempt}})" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "Réduire tous les groupes de tâches", "expandAll": "Développer tous les groupes de tâches" - }, - "taskLogs": { - "allLogLevels": "Tous les niveaux de journalisation", - "allSources": "Toutes les sources", - "fullscreen": { - "button": "Plein écran", - "tooltip": "Appuyez sur {{hotkey}} pour le plein écran" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/he/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/he/dag.json index 205d2a67a32..a05313b1352 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/he/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/he/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "כל רמות הרישום", + "allSources": "כל המקורות", + "fullscreen": { + "button": "מסך מלא", + "tooltip": "לחץ {{hotkey}} למסך מלא" + }, "noTryNumber": "אין מספר ניסיון", "viewInExternal": "צפה ברישומים ב-{{name}} (ניסיון {{attempt}})" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "כווץ את כל קבוצות המשימות", "expandAll": "הרחב את כל קבוצות המשימות" - }, - "taskLogs": { - "allLogLevels": "כל רמות הרישום", - "allSources": "כל המקורות", - "fullscreen": { - "button": "מסך מלא", - "tooltip": "לחץ {{hotkey}} למסך מלא" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/ko/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/ko/dag.json index a8a295e8872..49a5f616125 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/ko/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/ko/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "모든 로그 레벨", + "allSources": "모든 소스", + "fullscreen": { + "button": "전체 화면", + "tooltip": "전체 화면을 보려면 {{hotkey}}를 누르세요." + }, "noTryNumber": "시도 횟수 없음", "viewInExternal": "{{name}}에서 로그 보기 (시도 {{attempt}})" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "모든 작업 그룹 접기", "expandAll": "모든 작업 그룹 확장" - }, - "taskLogs": { - "allLogLevels": "모든 로그 레벨", - "allSources": "모든 소스", - "fullscreen": { - "button": "전체 화면", - "tooltip": "전체 화면을 보려면 {{hotkey}}를 누르세요." - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/pl/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/pl/dag.json index 8e271d98356..8a146731c12 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/pl/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/pl/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "Wszystkie poziomy logów", + "allSources": "Wszystkie źródła", + "fullscreen": { + "button": "Pełny ekran", + "tooltip": "Naciśnij {{hotkey}}, aby przejść do pełnego ekranu" + }, "noTryNumber": "Brak numeru próby", "viewInExternal": "Zobacz logi w {{name}} (próba {{attempt}})" }, @@ -108,13 +114,5 @@ "taskGroups": { "collapseAll": "Zwiń wszystkie grupy zadań", "expandAll": "Rozwiń wszystkie grupy zadań" - }, - "taskLogs": { - "allLogLevels": "Wszystkie poziomy logów", - "allSources": "Wszystkie źródła", - "fullscreen": { - "button": "Pełny ekran", - "tooltip": "Naciśnij {{hotkey}}, aby przejść do pełnego ekranu" - } } } diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json index 63311ed48dd..b72231c71bc 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json @@ -23,6 +23,12 @@ } }, "logs": { + "allLevels": "所有日誌等級", + "allSources": "所有來源", + "fullscreen": { + "button": "全螢幕", + "tooltip": "按下 {{hotkey}} 進入全螢幕" + }, "noTryNumber": "沒有嘗試次數", "viewInExternal": "在 {{name}} 中檢視日誌(嘗試 {{attempt}})" }, @@ -98,13 +104,5 @@ "taskGroups": { "collapseAll": "收合所有任務群組", "expandAll": "展開所有任務群組" - }, - "taskLogs": { - "allLogLevels": "所有日誌等級", - "allSources": "所有來源", - "fullscreen": { - "button": "全螢幕", - "tooltip": "按下 {{hotkey}} 進入全螢幕" - } } } diff --git a/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx b/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx index dd3f7bbfc04..cb50113ec82 100644 --- a/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx +++ b/airflow-core/src/airflow/ui/src/components/DagActions/RunBackfillForm.tsx @@ -193,7 +193,7 @@ const RunBackfillForm = ({ dag, onClose }: RunBackfillFormProps) => { colorPalette="blue" indicatorPlacement="start" key={item.value} - label={item.label} + label={translate(item.label)} value={item.value} /> ))} diff --git a/airflow-core/src/airflow/ui/src/constants/reprocessBehaviourParams.ts b/airflow-core/src/airflow/ui/src/constants/reprocessBehaviourParams.ts index 015898bbc7e..d19f435fdeb 100644 --- a/airflow-core/src/airflow/ui/src/constants/reprocessBehaviourParams.ts +++ b/airflow-core/src/airflow/ui/src/constants/reprocessBehaviourParams.ts @@ -17,7 +17,7 @@ * under the License. */ export const reprocessBehaviors = [ - { label: "Missing Runs", value: "none" }, - { label: "Missing and Errored Runs", value: "failed" }, - { label: "All Runs", value: "completed" }, + { label: "backfill.missingRuns", value: "none" }, + { label: "backfill.missingAndErroredRuns", value: "failed" }, + { label: "backfill.allRuns", value: "completed" }, ]; diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Backfills/Backfills.tsx b/airflow-core/src/airflow/ui/src/pages/Dag/Backfills/Backfills.tsx index 9b9ec34ab0d..649f3b5d4fe 100644 --- a/airflow-core/src/airflow/ui/src/pages/Dag/Backfills/Backfills.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Dag/Backfills/Backfills.tsx @@ -27,7 +27,6 @@ import { DataTable } from "src/components/DataTable"; import { useTableURLState } from "src/components/DataTable/useTableUrlState"; import { ErrorAlert } from "src/components/ErrorAlert"; import Time from "src/components/Time"; -import { reprocessBehaviors } from "src/constants/reprocessBehaviourParams"; import { getDuration } from "src/utils"; const getColumns = (translate: (key: string) => string): Array<ColumnDef<BackfillResponse>> => [ @@ -55,10 +54,11 @@ const getColumns = (translate: (key: string) => string): Array<ColumnDef<Backfil accessorKey: "reprocess_behavior", cell: ({ row }) => ( <Text> - { - reprocessBehaviors.find((rb: { value: string }) => rb.value === row.original.reprocess_behavior) - ?.label - } + {row.original.reprocess_behavior === "none" + ? translate("backfill.missingRuns") + : row.original.reprocess_behavior === "failed" + ? translate("backfill.missingAndErroredRuns") + : translate("backfill.allRuns")} </Text> ), enableSorting: false, diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx index 30411848851..25dc8bccf06 100644 --- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx @@ -17,6 +17,7 @@ * under the License. */ import { ReactFlowProvider } from "@xyflow/react"; +import { useTranslation } from "react-i18next"; import { MdOutlineTask } from "react-icons/md"; import { useParams } from "react-router-dom"; @@ -28,13 +29,13 @@ import { Header } from "./Header"; export const GroupTaskInstance = () => { const { dagId = "", runId = "", taskId = "" } = useParams(); - + const { t: translate } = useTranslation(); const { data: gridTISummaries } = useGridTiSummaries({ dagId, runId }); const taskInstance = gridTISummaries?.task_instances.find((ti) => ti.task_id === taskId); const refetchInterval = useAutoRefresh({ dagId }); - const tabs = [{ icon: <MdOutlineTask />, label: "Task Instances", value: "" }]; + const tabs = [{ icon: <MdOutlineTask />, label: translate("taskInstances_other"), value: "" }]; return ( <ReactFlowProvider> diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx index 4c9bd90f39d..9bfd54bfda4 100644 --- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/Header.tsx @@ -18,6 +18,7 @@ */ import { Box } from "@chakra-ui/react"; import type { ReactNode } from "react"; +import { useTranslation } from "react-i18next"; import { MdOutlineTask } from "react-icons/md"; import type { LightGridTaskInstanceSummary } from "openapi/requests/types.gen"; @@ -32,19 +33,20 @@ export const Header = ({ readonly isRefreshing?: boolean; readonly taskInstance: LightGridTaskInstanceSummary; }) => { + const { t: translate } = useTranslation(); const entries: Array<{ label: string; value: number | ReactNode | string }> = []; Object.entries(taskInstance.child_states ?? {}).forEach(([state, count]) => { - entries.push({ label: `Total ${state}`, value: count }); + entries.push({ label: translate("total", { state }), value: count }); }); const stats = [ ...entries, - { label: "Earliest Start", value: <Time datetime={taskInstance.min_start_date} /> }, - { label: "Latest End", value: <Time datetime={taskInstance.max_end_date} /> }, + { label: translate("startDate"), value: <Time datetime={taskInstance.min_start_date} /> }, + { label: translate("endDate"), value: <Time datetime={taskInstance.max_end_date} /> }, ...(Boolean(taskInstance.max_end_date) ? [ { - label: "Total Duration", + label: translate("duration"), value: getDuration(taskInstance.min_start_date, taskInstance.max_end_date), }, ] diff --git a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx index fc98b1a7806..dd00399a8ed 100644 --- a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx +++ b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Header.tsx @@ -18,6 +18,7 @@ */ import { Box } from "@chakra-ui/react"; import type { ReactNode } from "react"; +import { useTranslation } from "react-i18next"; import { MdOutlineTask } from "react-icons/md"; import type { LightGridTaskInstanceSummary } from "openapi/requests/types.gen"; @@ -32,19 +33,25 @@ export const Header = ({ readonly isRefreshing?: boolean; readonly taskInstance: LightGridTaskInstanceSummary; }) => { + const { t: translate } = useTranslation(); const entries: Array<{ label: string; value: number | ReactNode | string }> = []; let taskCount: number = 0; Object.entries(taskInstance.child_states ?? {}).forEach(([state, count]) => { - entries.push({ label: `Total ${state}`, value: count }); + entries.push({ label: translate("total", { state }), value: count }); taskCount += count; }); const stats = [ ...entries, - { label: "Start", value: <Time datetime={taskInstance.min_start_date} /> }, - { label: "End", value: <Time datetime={taskInstance.max_end_date} /> }, + { label: translate("startDate"), value: <Time datetime={taskInstance.min_start_date} /> }, + { label: translate("endDate"), value: <Time datetime={taskInstance.max_end_date} /> }, ...(Boolean(taskInstance.max_end_date) - ? [{ label: "Duration", value: getDuration(taskInstance.min_start_date, taskInstance.max_end_date) }] + ? [ + { + label: translate("duration"), + value: getDuration(taskInstance.min_start_date, taskInstance.max_end_date), + }, + ] : []), ]; diff --git a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx index 005ca58a051..57a5c68a591 100644 --- a/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx +++ b/airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx @@ -17,6 +17,7 @@ * under the License. */ import { ReactFlowProvider } from "@xyflow/react"; +import { useTranslation } from "react-i18next"; import { MdOutlineTask } from "react-icons/md"; import { useParams } from "react-router-dom"; @@ -29,7 +30,7 @@ import { Header } from "./Header"; export const MappedTaskInstance = () => { const { dagId = "", runId = "", taskId = "" } = useParams(); const refetchInterval = useAutoRefresh({ dagId }); - + const { t: translate } = useTranslation(); const { data: gridTISummaries } = useGridTiSummaries({ dagId, runId }); const taskInstance = gridTISummaries?.task_instances.find((ti) => ti.task_id === taskId); @@ -39,7 +40,9 @@ export const MappedTaskInstance = () => { taskCount += count; }); - const tabs = [{ icon: <MdOutlineTask />, label: `Task Instances [${taskCount}]`, value: "" }]; + const tabs = [ + { icon: <MdOutlineTask />, label: `${translate("taskInstances_other")} [${taskCount}]`, value: "" }, + ]; return ( <ReactFlowProvider> diff --git a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx index fac4a8082ec..44613a5b1a3 100644 --- a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx +++ b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx @@ -74,7 +74,7 @@ export const TaskLogHeader = ({ value: string; }>({ items: [ - { label: translate("dag:taskLogs.allSources"), value: "all" }, + { label: translate("dag:logs.allSources"), value: "all" }, ...(sourceOptions ?? []).map((source) => ({ label: source, value: source })), ], }); @@ -143,7 +143,7 @@ export const TaskLogHeader = ({ ))} </HStack> ) : ( - translate("dag:taskLogs.allLogLevels") + translate("dag:logs.allLevels") ) } </Select.ValueText> @@ -152,9 +152,11 @@ export const TaskLogHeader = ({ {logLevelOptions.items.map((option) => ( <Select.Item item={option} key={option.label}> {option.value === "all" ? ( - option.label + translate(option.label) ) : ( - <Badge colorPalette={logLevelColorMapping[option.value as LogLevel]}>{option.label}</Badge> + <Badge colorPalette={logLevelColorMapping[option.value as LogLevel]}> + {translate(option.label)} + </Badge> )} </Select.Item> ))} @@ -169,7 +171,7 @@ export const TaskLogHeader = ({ value={sources} > <Select.Trigger clearable> - <Select.ValueText placeholder={translate("dag:taskLogs.allSources")} /> + <Select.ValueText placeholder={translate("dag:logs.allSources")} /> </Select.Trigger> <Select.Content> {sourceOptionList.items.map((option) => ( @@ -194,11 +196,11 @@ export const TaskLogHeader = ({ {!isFullscreen && ( <Tooltip closeDelay={100} - content={translate("dag:taskLogs.fullscreen.tooltip", { hotkey: "f" })} + content={translate("dag:logs.fullscreen.tooltip", { hotkey: "f" })} openDelay={100} > <IconButton - aria-label={translate("dag:taskLogs.fullscreen.button")} + aria-label={translate("dag:logs.fullscreen.button")} bg="bg.panel" onClick={toggleFullscreen} variant="outline" diff --git a/airflow-core/src/airflow/ui/src/utils/logs.ts b/airflow-core/src/airflow/ui/src/utils/logs.ts index f0557e21f33..d03eedb8803 100644 --- a/airflow-core/src/airflow/ui/src/utils/logs.ts +++ b/airflow-core/src/airflow/ui/src/utils/logs.ts @@ -43,11 +43,11 @@ export const logLevelOptions = createListCollection<{ value: string; }>({ items: [ - { label: "All Levels", value: "all" }, - { label: LogLevel.DEBUG.toUpperCase(), value: LogLevel.DEBUG }, - { label: LogLevel.INFO.toUpperCase(), value: LogLevel.INFO }, - { label: LogLevel.WARNING.toUpperCase(), value: LogLevel.WARNING }, - { label: LogLevel.ERROR.toUpperCase(), value: LogLevel.ERROR }, - { label: LogLevel.CRITICAL.toUpperCase(), value: LogLevel.CRITICAL }, + { label: "dag:logs.allLevels", value: "all" }, + { label: "dag:logs.debug", value: LogLevel.DEBUG }, + { label: "dag:logs.info", value: LogLevel.INFO }, + { label: "dag:logs.warning", value: LogLevel.WARNING }, + { label: "dag:logs.error", value: LogLevel.ERROR }, + { label: "dag:logs.critical", value: LogLevel.CRITICAL }, ], });