This is an automated email from the ASF dual-hosted git repository.
bbovenzi 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 de9470e9b27 Add some missing translations (#51666)
de9470e9b27 is described below
commit de9470e9b274685a3fbcf2a3a622389040a4afb1
Author: Brent Bovenzi <[email protected]>
AuthorDate: Thu Jun 12 15:42:56 2025 -0400
Add some missing translations (#51666)
* Add some missing translations
* Fix tooltip content translations
---
.../ui/src/components/DataTable/TableList.tsx | 2 +-
.../src/components/TriggerDag/TriggerDAGModal.tsx | 2 +-
.../airflow/ui/src/components/ui/CloseButton.tsx | 15 ++++++++----
.../src/airflow/ui/src/i18n/locales/de/common.json | 2 +-
.../src/airflow/ui/src/i18n/locales/en/admin.json | 7 ++++--
.../src/airflow/ui/src/i18n/locales/en/common.json | 2 +-
.../airflow/ui/src/i18n/locales/en/components.json | 2 ++
.../src/airflow/ui/src/i18n/locales/en/dag.json | 8 +++++++
.../src/airflow/ui/src/i18n/locales/pl/common.json | 2 +-
.../airflow/ui/src/i18n/locales/zh-TW/common.json | 2 +-
.../ui/src/pages/Connections/Connections.tsx | 4 ++--
.../pages/Connections/DeleteConnectionsButton.tsx | 2 +-
.../src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx | 2 +-
.../src/pages/TaskInstance/Logs/TaskLogHeader.tsx | 27 +++++++++++++++-------
.../airflow/ui/src/pages/Variables/Variables.tsx | 4 ++--
15 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/components/DataTable/TableList.tsx
b/airflow-core/src/airflow/ui/src/components/DataTable/TableList.tsx
index 6be9ca14675..4b9574f6531 100644
--- a/airflow-core/src/airflow/ui/src/components/DataTable/TableList.tsx
+++ b/airflow-core/src/airflow/ui/src/components/DataTable/TableList.tsx
@@ -59,7 +59,7 @@ export const TableList = <TData,>({ allowFiltering,
renderSubComponent, table }:
<Table.ColumnHeader colSpan={colSpan} key={id}
whiteSpace="nowrap">
{isPlaceholder ? undefined : (
<Button
- aria-label="sort"
+ aria-label={translate("sort")}
disabled={!canSort}
onClick={column.getToggleSortingHandler()}
variant="plain"
diff --git
a/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGModal.tsx
b/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGModal.tsx
index 439af9695c4..058a3cc9f3c 100644
--- a/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGModal.tsx
+++ b/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGModal.tsx
@@ -109,7 +109,7 @@ const TriggerDAGModal: React.FC<TriggerDAGModalProps> = ({
label={translate("triggerDag.selectLabel")}
value={RunMode.SINGLE}
/>
- <Tooltip content="Backfill requires a schedule"
disabled={hasSchedule}>
+ <Tooltip content={translate("backfill.tooltip")}
disabled={hasSchedule}>
<RadioCardItem
description={translate("backfill.selectDescription")}
disabled={!hasSchedule}
diff --git a/airflow-core/src/airflow/ui/src/components/ui/CloseButton.tsx
b/airflow-core/src/airflow/ui/src/components/ui/CloseButton.tsx
index d0640600cd1..a044660c695 100644
--- a/airflow-core/src/airflow/ui/src/components/ui/CloseButton.tsx
+++ b/airflow-core/src/airflow/ui/src/components/ui/CloseButton.tsx
@@ -19,12 +19,17 @@
import type { ButtonProps as ChakraCloseButtonProps } from "@chakra-ui/react";
import { IconButton as ChakraIconButton } from "@chakra-ui/react";
import { forwardRef } from "react";
+import { useTranslation } from "react-i18next";
import { LuX } from "react-icons/lu";
export type CloseButtonProps = {} & ChakraCloseButtonProps;
-export const CloseButton = forwardRef<HTMLButtonElement,
CloseButtonProps>((props, ref) => (
- <ChakraIconButton aria-label="Close" ref={ref} variant="ghost" {...props}>
- {props.children ?? <LuX />}
- </ChakraIconButton>
-));
+export const CloseButton = forwardRef<HTMLButtonElement,
CloseButtonProps>((props, ref) => {
+ const { t: translate } = useTranslation(["components"]);
+
+ return (
+ <ChakraIconButton aria-label={translate("close")} ref={ref}
variant="ghost" {...props}>
+ {props.children ?? <LuX />}
+ </ChakraIconButton>
+ );
+});
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/de/common.json
b/airflow-core/src/airflow/ui/src/i18n/locales/de/common.json
index 4ca9b4228d0..9498b866488 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/de/common.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/de/common.json
@@ -195,7 +195,7 @@
"tryNumber": "Versuch Nummer",
"user": "Benutzer",
"wrap": {
- "tooltip": "Buchstabe w drücken um den Zeilenumbruch umzuschalten",
+ "tooltip": "Buchstabe {{hotkey}} drücken um den Zeilenumbruch
umzuschalten",
"unwrap": "Kein Zeilenumbruch",
"wrap": "Zeilenumbruch"
}
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/admin.json
b/airflow-core/src/airflow/ui/src/i18n/locales/en/admin.json
index a0de0cc1490..c8684c15927 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/admin.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/admin.json
@@ -49,7 +49,8 @@
"secondConfirmMessage": "This action is permanent and cannot be undone.",
"thirdConfirmMessage": " Are you sure you want to proceed?"
},
- "selected": "Selected"
+ "selected": "Selected",
+ "tooltip": "Delete selected connections"
},
"formActions":{
"reset": "Reset",
@@ -103,10 +104,12 @@
"deleteVariable_other": "Delete {{count}} Variables",
"firstConfirmMessage_one": "You are about to delete the following
variable:",
"firstConfirmMessage_other": "You are about to delete the following
variables:",
- "title": "Delete Variable"
+ "title": "Delete Variable",
+ "tooltip": "Delete selected variables"
},
"edit": "Edit Variable",
"export": "Export",
+ "exportTooltip": "Export selected variables",
"form": {
"invalidJson": "Invalid JSON",
"keyMaxLength": "Key can contain a maximum of 250 characters",
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
b/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
index 92ed06fc380..0cebcabf44a 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
@@ -227,7 +227,7 @@
"tryNumber": "Try Number",
"user": "User",
"wrap": {
- "tooltip": "Press w to toggle wrap",
+ "tooltip": "Press {{hotkey}} to toggle wrap",
"unwrap": "Unwrap",
"wrap": "Wrap"
}
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/components.json
b/airflow-core/src/airflow/ui/src/i18n/locales/en/components.json
index d4526010cd1..e1e5b3973df 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/components.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/components.json
@@ -14,6 +14,7 @@
"selectDescription": "Run this Dag for a range of dates",
"selectLabel": "Backfill",
"title": "Run Backfill",
+ "tooltip": "Backfill requires a schedule",
"unpause": "Unpause {{dag_display_name}} on trigger"
},
"banner": {
@@ -25,6 +26,7 @@
"clipboard": {
"copy": "Copy"
},
+ "close": "Close",
"configForm": {
"advancedOptions": "Advanced Options",
"configJson": "Configuration JSON",
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
b/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
index 4a1a3c6f9f6..3c3cd336341 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
@@ -85,5 +85,13 @@
"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/src/i18n/locales/pl/common.json
b/airflow-core/src/airflow/ui/src/i18n/locales/pl/common.json
index 463a276c9f4..e9043f0d5d9 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/pl/common.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/pl/common.json
@@ -188,7 +188,7 @@
"tryNumber": "Numer próby",
"user": "Użytkownik",
"wrap": {
- "tooltip": "Wybierz w aby przełączyć zawijanie",
+ "tooltip": "Wybierz {{hotkey}} aby przełączyć zawijanie",
"unwrap": "Wyłącz zawijanie",
"wrap": "Włącz zawijanie"
}
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/zh-TW/common.json
b/airflow-core/src/airflow/ui/src/i18n/locales/zh-TW/common.json
index 612422256c5..8fb13d9d2dd 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/zh-TW/common.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/zh-TW/common.json
@@ -171,7 +171,7 @@
"tryNumber": "嘗試次數",
"user": "使用者",
"wrap": {
- "tooltip": "按 w 切換換行",
+ "tooltip": "按 {{hotkey}} 切換換行",
"unwrap": "不換行",
"wrap": "換行"
}
diff --git a/airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx
b/airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx
index 3ce3a020cb2..8145c6744d0 100644
--- a/airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx
@@ -123,7 +123,7 @@ const getColumns = ({
];
export const Connections = () => {
- const { t: translate } = useTranslation("admin");
+ const { t: translate } = useTranslation(["admin", "common"]);
const { setTableURLState, tableURLState } = useTableURLState();
const [searchParams, setSearchParams] = useSearchParams();
const { NAME_PATTERN: NAME_PATTERN_PARAM }: SearchParamsKeysType =
SearchParamsKeys;
@@ -208,7 +208,7 @@ export const Connections = () => {
{selectedRows.size} {translate("deleteActions.selected")}
</ActionBar.SelectionTrigger>
<ActionBar.Separator />
- <Tooltip content="Delete selected connections">
+ <Tooltip content={translate("deleteActions.tooltip")}>
<DeleteConnectionsButton
clearSelections={clearSelections}
deleteKeys={[...selectedRows.keys()]}
diff --git
a/airflow-core/src/airflow/ui/src/pages/Connections/DeleteConnectionsButton.tsx
b/airflow-core/src/airflow/ui/src/pages/Connections/DeleteConnectionsButton.tsx
index fcaf2178351..7f38ca2a166 100644
---
a/airflow-core/src/airflow/ui/src/pages/Connections/DeleteConnectionsButton.tsx
+++
b/airflow-core/src/airflow/ui/src/pages/Connections/DeleteConnectionsButton.tsx
@@ -43,7 +43,7 @@ const DeleteConnectionsButton = ({ clearSelections,
deleteKeys: connectionIds }:
return (
<>
- <Button aria-label="Delete selected connections" onClick={onOpen}
size="sm" variant="outline">
+ <Button aria-label={translate("deleteActions.button")} onClick={onOpen}
size="sm" variant="outline">
<FiTrash2 /> {translate("deleteActions.button")}
</Button>
diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
index 75b4cc81ff0..063790aba47 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Tasks/Tasks.tsx
@@ -60,7 +60,7 @@ export const Tasks = () => {
displayMode="card"
isFetching={isFetching}
isLoading={isLoading}
- modelName="Task"
+ modelName={translate("task_one")}
total={data ? data.total_entries : 0}
/>
</Box>
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 a48f2503e02..fac4a8082ec 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
@@ -25,6 +25,7 @@ import {
type SelectValueChangeDetails,
} from "@chakra-ui/react";
import { useCallback } from "react";
+import { useTranslation } from "react-i18next";
import { MdOutlineOpenInFull } from "react-icons/md";
import { useSearchParams } from "react-router-dom";
@@ -56,6 +57,7 @@ export const TaskLogHeader = ({
tryNumber,
wrap,
}: Props) => {
+ const { t: translate } = useTranslation(["common", "dag"]);
const [searchParams, setSearchParams] = useSearchParams();
const sources = searchParams.getAll(SearchParamsKeys.SOURCE);
const logLevels = searchParams.getAll(SearchParamsKeys.LOG_LEVEL);
@@ -72,7 +74,7 @@ export const TaskLogHeader = ({
value: string;
}>({
items: [
- { label: "All Sources", value: "all" },
+ { label: translate("dag:taskLogs.allSources"), value: "all" },
...(sourceOptions ?? []).map((source) => ({ label: source, value: source
})),
],
});
@@ -141,7 +143,7 @@ export const TaskLogHeader = ({
))}
</HStack>
) : (
- "All Log Levels"
+ translate("dag:taskLogs.allLogLevels")
)
}
</Select.ValueText>
@@ -167,7 +169,7 @@ export const TaskLogHeader = ({
value={sources}
>
<Select.Trigger clearable>
- <Select.ValueText placeholder="All Sources" />
+ <Select.ValueText
placeholder={translate("dag:taskLogs.allSources")} />
</Select.Trigger>
<Select.Content>
{sourceOptionList.items.map((option) => (
@@ -179,19 +181,28 @@ export const TaskLogHeader = ({
</Select.Root>
) : undefined}
<HStack>
- <Tooltip closeDelay={100} content="Press w to toggle wrap"
openDelay={100}>
+ <Tooltip closeDelay={100} content={translate("wrap.tooltip", {
hotkey: "w" })} openDelay={100}>
<Button
- aria-label={wrap ? "Unwrap" : "Wrap"}
+ aria-label={wrap ? translate("wrap.unwrap") :
translate("wrap.wrap")}
bg="bg.panel"
onClick={toggleWrap}
variant="outline"
>
- {wrap ? "Unwrap" : "Wrap"}
+ {wrap ? translate("wrap.unwrap") : translate("wrap.wrap")}
</Button>
</Tooltip>
{!isFullscreen && (
- <Tooltip closeDelay={100} content="Press f for fullscreen"
openDelay={100}>
- <IconButton aria-label="Full screen" bg="bg.panel"
onClick={toggleFullscreen} variant="outline">
+ <Tooltip
+ closeDelay={100}
+ content={translate("dag:taskLogs.fullscreen.tooltip", { hotkey:
"f" })}
+ openDelay={100}
+ >
+ <IconButton
+ aria-label={translate("dag:taskLogs.fullscreen.button")}
+ bg="bg.panel"
+ onClick={toggleFullscreen}
+ variant="outline"
+ >
<MdOutlineOpenInFull />
</IconButton>
</Tooltip>
diff --git a/airflow-core/src/airflow/ui/src/pages/Variables/Variables.tsx
b/airflow-core/src/airflow/ui/src/pages/Variables/Variables.tsx
index 10cd89138bf..052da890b36 100644
--- a/airflow-core/src/airflow/ui/src/pages/Variables/Variables.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Variables/Variables.tsx
@@ -223,10 +223,10 @@ export const Variables = () => {
{selectedRows.size} {translate("deleteActions.selected")}
</ActionBar.SelectionTrigger>
<ActionBar.Separator />
- <Tooltip content="Delete selected variables">
+ <Tooltip content={translate("variables.delete.tooltip")}>
<DeleteVariablesButton clearSelections={clearSelections}
deleteKeys={[...selectedRows.keys()]} />
</Tooltip>
- <Tooltip content="Export selected variables">
+ <Tooltip content={translate("variables.exportTooltip")}>
<Button onClick={() => downloadJson(selectedVariables,
"variables")} size="sm" variant="outline">
<FiShare />
{translate("variables.export")}