Skip to content

Commit

Permalink
chore: workflow BRANCH, PARALLEL i18n (#8452)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuzooVn authored Sep 15, 2024
1 parent b73faae commit aa5b2db
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/app/components/workflow/run/tracing-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
RiArrowDownSLine,
RiMenu4Line,
} from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import NodePanel from './node'
import {
BlockEnum,
Expand All @@ -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 } = {}
Expand All @@ -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 => {
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions web/i18n/de-DE/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/en-US/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/es-ES/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/fa-IR/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
jumpToNode: 'پرش به این گره',
parallelRun: 'اجرای موازی',
addParallelNode: 'افزودن گره موازی',
parallel: 'موازی',
branch: 'شاخه',
},
env: {
envPanelTitle: 'متغیرهای محیطی',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/fr-FR/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/hi-IN/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ const translation = {
parallelRun: 'समानांतर रन',
jumpToNode: 'इस नोड पर जाएं',
addParallelNode: 'समानांतर नोड जोड़ें',
parallel: 'समानांतर',
branch: 'शाखा',
},
env: {
envPanelTitle: 'पर्यावरण चर',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/it-IT/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/ja-JP/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
disconnect: '切る',
jumpToNode: 'このノードにジャンプします',
addParallelNode: '並列ノードを追加',
parallel: '並列',
branch: 'ブランチ',
},
env: {
envPanelTitle: '環境変数',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/ko-KR/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
disconnect: '분리하다',
jumpToNode: '이 노드로 이동',
addParallelNode: '병렬 노드 추가',
parallel: '병렬',
branch: '브랜치',
},
env: {
envPanelTitle: '환경 변수',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/pl-PL/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/pt-BR/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/ro-RO/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/ru-RU/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
disconnect: 'Разъединять',
jumpToNode: 'Перейти к этому узлу',
addParallelNode: 'Добавить параллельный узел',
parallel: 'ПАРАЛЛЕЛЬНЫЙ',
branch: 'ВЕТКА',
},
env: {
envPanelTitle: 'Переменные среды',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/tr-TR/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/uk-UA/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
parallelRun: 'Паралельний біг',
jumpToNode: 'Перейти до цього вузла',
addParallelNode: 'Додати паралельний вузол',
parallel: 'ПАРАЛЕЛЬНИЙ',
branch: 'ГІЛКА',
},
env: {
envPanelTitle: 'Змінні середовища',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/vi-VN/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/zh-Hans/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
disconnect: '断开连接',
jumpToNode: '跳转到节点',
addParallelNode: '添加并行节点',
parallel: '并行',
branch: '分支',
},
env: {
envPanelTitle: '环境变量',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/zh-Hant/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const translation = {
disconnect: '斷開',
jumpToNode: '跳轉到此節點',
addParallelNode: '添加並行節點',
parallel: '並行',
branch: '分支',
},
env: {
envPanelTitle: '環境變數',
Expand Down

0 comments on commit aa5b2db

Please sign in to comment.