Files
ComfyUI_frontend/src/composables/bottomPanelTabs/useTerminalTabs.ts
Benjamin Lu 7a1a2dd654 fix: Make bottom panel tab titles reactive to language changes (#5077)
* computed extraMenuItems

* add i18n key option

* underline fix

* Update locales [skip ci]

* restore title

* Update locales [skip ci]

* refactor: Extract tab title logic to helper method for better readability

- Moved complex nested ternary logic from template to getTabDisplayTitle helper
- Improves code readability and maintainability
- Addresses review feedback about using computed/method for performance

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-08-18 19:27:21 -04:00

29 lines
955 B
TypeScript

import { markRaw } from 'vue'
import { useI18n } from 'vue-i18n'
import CommandTerminal from '@/components/bottomPanel/tabs/terminal/CommandTerminal.vue'
import LogsTerminal from '@/components/bottomPanel/tabs/terminal/LogsTerminal.vue'
import { BottomPanelExtension } from '@/types/extensionTypes'
export const useLogsTerminalTab = (): BottomPanelExtension => {
const { t } = useI18n()
return {
id: 'logs-terminal',
title: t('g.logs'), // For command labels (collected by i18n workflow)
titleKey: 'g.logs', // For dynamic translation in UI
component: markRaw(LogsTerminal),
type: 'vue'
}
}
export const useCommandTerminalTab = (): BottomPanelExtension => {
const { t } = useI18n()
return {
id: 'command-terminal',
title: t('g.terminal'), // For command labels (collected by i18n workflow)
titleKey: 'g.terminal', // For dynamic translation in UI
component: markRaw(CommandTerminal),
type: 'vue'
}
}