瀏覽代碼

chore: workflow BRANCH, PARALLEL i18n (#8452)

Nam Vu 7 月之前
父節點
當前提交
aa5b2db10a

+ 6 - 4
web/app/components/workflow/run/tracing-panel.tsx

@@ -11,6 +11,7 @@ import {
   RiArrowDownSLine,
   RiMenu4Line,
 } from '@remixicon/react'
+import { useTranslation } from 'react-i18next'
 import NodePanel from './node'
 import {
   BlockEnum,
@@ -37,7 +38,7 @@ type TracingNodeProps = {
   hideNodeProcessDetail?: boolean
 }
 
-function buildLogTree(nodes: NodeTracing[]): TracingNodeProps[] {
+function buildLogTree(nodes: NodeTracing[], t: (key: string) => string): TracingNodeProps[] {
   const rootNodes: TracingNodeProps[] = []
   const parallelStacks: { [key: string]: TracingNodeProps } = {}
   const levelCounts: { [key: string]: number } = {}
@@ -58,7 +59,7 @@ function buildLogTree(nodes: NodeTracing[]): TracingNodeProps[] {
     const parentTitle = parentId ? parallelStacks[parentId]?.parallelTitle : ''
     const levelNumber = parentTitle ? parseInt(parentTitle.split('-')[1]) + 1 : 1
     const letter = parallelChildCounts[levelKey]?.size > 1 ? String.fromCharCode(64 + levelCounts[levelKey]) : ''
-    return `PARALLEL-${levelNumber}${letter}`
+    return `${t('workflow.common.parallel')}-${levelNumber}${letter}`
   }
 
   const getBranchTitle = (parentId: string | null, branchNum: number): string => {
@@ -67,7 +68,7 @@ function buildLogTree(nodes: NodeTracing[]): TracingNodeProps[] {
     const levelNumber = parentTitle ? parseInt(parentTitle.split('-')[1]) + 1 : 1
     const letter = parallelChildCounts[levelKey]?.size > 1 ? String.fromCharCode(64 + levelCounts[levelKey]) : ''
     const branchLetter = String.fromCharCode(64 + branchNum)
-    return `BRANCH-${levelNumber}${letter}-${branchLetter}`
+    return `${t('workflow.common.branch')}-${levelNumber}${letter}-${branchLetter}`
   }
 
   // Count parallel children (for figuring out if we need to use letters)
@@ -163,7 +164,8 @@ const TracingPanel: FC<TracingPanelProps> = ({
   hideNodeInfo = false,
   hideNodeProcessDetail = false,
 }) => {
-  const treeNodes = buildLogTree(list)
+  const { t } = useTranslation()
+  const treeNodes = buildLogTree(list, t)
   const [collapsedNodes, setCollapsedNodes] = useState<Set<string>>(new Set())
   const [hoveredParallel, setHoveredParallel] = useState<string | null>(null)
 

+ 2 - 0
web/i18n/de-DE/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Trennen',
     jumpToNode: 'Zu diesem Knoten springen',
     addParallelNode: 'Parallelen Knoten hinzufügen',
+    parallel: 'PARALLEL',
+    branch: 'ZWEIG',
   },
   env: {
     envPanelTitle: 'Umgebungsvariablen',

+ 2 - 0
web/i18n/en-US/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Disconnect',
     jumpToNode: 'Jump to this node',
     addParallelNode: 'Add Parallel Node',
+    parallel: 'PARALLEL',
+    branch: 'BRANCH',
   },
   env: {
     envPanelTitle: 'Environment Variables',

+ 2 - 0
web/i18n/es-ES/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Desconectar',
     jumpToNode: 'Saltar a este nodo',
     addParallelNode: 'Agregar nodo paralelo',
+    parallel: 'PARALELO',
+    branch: 'RAMA',
   },
   env: {
     envPanelTitle: 'Variables de Entorno',

+ 2 - 0
web/i18n/fa-IR/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     jumpToNode: 'پرش به این گره',
     parallelRun: 'اجرای موازی',
     addParallelNode: 'افزودن گره موازی',
+    parallel: 'موازی',
+    branch: 'شاخه',
   },
   env: {
     envPanelTitle: 'متغیرهای محیطی',

+ 2 - 0
web/i18n/fr-FR/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Déconnecter',
     jumpToNode: 'Aller à ce nœud',
     addParallelNode: 'Ajouter un nœud parallèle',
+    parallel: 'PARALLÈLE',
+    branch: 'BRANCHE',
   },
   env: {
     envPanelTitle: 'Variables d\'Environnement',

+ 2 - 0
web/i18n/hi-IN/workflow.ts

@@ -96,6 +96,8 @@ const translation = {
     parallelRun: 'समानांतर रन',
     jumpToNode: 'इस नोड पर जाएं',
     addParallelNode: 'समानांतर नोड जोड़ें',
+    parallel: 'समानांतर',
+    branch: 'शाखा',
   },
   env: {
     envPanelTitle: 'पर्यावरण चर',

+ 2 - 0
web/i18n/it-IT/workflow.ts

@@ -97,6 +97,8 @@ const translation = {
     disconnect: 'Disconnettere',
     jumpToNode: 'Vai a questo nodo',
     addParallelNode: 'Aggiungi nodo parallelo',
+    parallel: 'PARALLELO',
+    branch: 'RAMO',
   },
   env: {
     envPanelTitle: 'Variabili d\'Ambiente',

+ 2 - 0
web/i18n/ja-JP/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: '切る',
     jumpToNode: 'このノードにジャンプします',
     addParallelNode: '並列ノードを追加',
+    parallel: '並列',
+    branch: 'ブランチ',
   },
   env: {
     envPanelTitle: '環境変数',

+ 2 - 0
web/i18n/ko-KR/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: '분리하다',
     jumpToNode: '이 노드로 이동',
     addParallelNode: '병렬 노드 추가',
+    parallel: '병렬',
+    branch: '브랜치',
   },
   env: {
     envPanelTitle: '환경 변수',

+ 2 - 0
web/i18n/pl-PL/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     jumpToNode: 'Przejdź do tego węzła',
     disconnect: 'Odłączyć',
     addParallelNode: 'Dodaj węzeł równoległy',
+    parallel: 'RÓWNOLEGŁY',
+    branch: 'GAŁĄŹ',
   },
   env: {
     envPanelTitle: 'Zmienne Środowiskowe',

+ 2 - 0
web/i18n/pt-BR/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Desligar',
     jumpToNode: 'Ir para este nó',
     addParallelNode: 'Adicionar nó paralelo',
+    parallel: 'PARALELO',
+    branch: 'RAMIFICAÇÃO',
   },
   env: {
     envPanelTitle: 'Variáveis de Ambiente',

+ 2 - 0
web/i18n/ro-RO/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Deconecta',
     jumpToNode: 'Sari la acest nod',
     addParallelNode: 'Adăugare nod paralel',
+    parallel: 'PARALEL',
+    branch: 'RAMURĂ',
   },
   env: {
     envPanelTitle: 'Variabile de Mediu',

+ 2 - 0
web/i18n/ru-RU/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Разъединять',
     jumpToNode: 'Перейти к этому узлу',
     addParallelNode: 'Добавить параллельный узел',
+    parallel: 'ПАРАЛЛЕЛЬНЫЙ',
+    branch: 'ВЕТКА',
   },
   env: {
     envPanelTitle: 'Переменные среды',

+ 2 - 0
web/i18n/tr-TR/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     addParallelNode: 'Paralel Düğüm Ekle',
     disconnect: 'Ayırmak',
     parallelRun: 'Paralel Koşu',
+    parallel: 'PARALEL',
+    branch: 'DAL',
   },
   env: {
     envPanelTitle: 'Çevre Değişkenleri',

+ 2 - 0
web/i18n/uk-UA/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     parallelRun: 'Паралельний біг',
     jumpToNode: 'Перейти до цього вузла',
     addParallelNode: 'Додати паралельний вузол',
+    parallel: 'ПАРАЛЕЛЬНИЙ',
+    branch: 'ГІЛКА',
   },
   env: {
     envPanelTitle: 'Змінні середовища',

+ 2 - 0
web/i18n/vi-VN/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: 'Ngắt kết nối',
     jumpToNode: 'Chuyển đến nút này',
     addParallelNode: 'Thêm nút song song',
+    parallel: 'SONG SONG',
+    branch: 'NHÁNH',
   },
   env: {
     envPanelTitle: 'Biến Môi Trường',

+ 2 - 0
web/i18n/zh-Hans/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: '断开连接',
     jumpToNode: '跳转到节点',
     addParallelNode: '添加并行节点',
+    parallel: '并行',
+    branch: '分支',
   },
   env: {
     envPanelTitle: '环境变量',

+ 2 - 0
web/i18n/zh-Hant/workflow.ts

@@ -93,6 +93,8 @@ const translation = {
     disconnect: '斷開',
     jumpToNode: '跳轉到此節點',
     addParallelNode: '添加並行節點',
+    parallel: '並行',
+    branch: '分支',
   },
   env: {
     envPanelTitle: '環境變數',