mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 07:14:11 +00:00
fix: localize node definition filter names and descriptions (#8540)
## Summary Localizes node definition filter names and descriptions using vue-i18n, following the project's coding guidelines. ## Changes - Updated `registerCoreNodeDefFilters()` in `src/stores/nodeDefStore.ts` to use `t()` function calls - Added translation keys under `nodeFilters` namespace in `src/locales/en/main.json` ## Affected Filters | Filter ID | Name | |-----------|------| | `core.deprecated` | Hide Deprecated Nodes | | `core.experimental` | Hide Experimental Nodes | | `core.dev_only` | Hide Dev-Only Nodes | | `core.subgraph` | Hide Subgraph Nodes | Fixes #8390 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8540-fix-localize-node-definition-filter-names-and-descriptions-2fb6d73d365081f29506ed804c233b5a) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -2851,5 +2851,15 @@
|
||||
"label": "Preview Version",
|
||||
"tooltip": "You are using a nightly version of ComfyUI. Please use the feedback button to share your thoughts about these features."
|
||||
}
|
||||
},
|
||||
"nodeFilters": {
|
||||
"hideDeprecated": "Hide Deprecated Nodes",
|
||||
"hideDeprecatedDescription": "Hides nodes marked as deprecated unless explicitly enabled",
|
||||
"hideExperimental": "Hide Experimental Nodes",
|
||||
"hideExperimentalDescription": "Hides nodes marked as experimental unless explicitly enabled",
|
||||
"hideDevOnly": "Hide Dev-Only Nodes",
|
||||
"hideDevOnlyDescription": "Hides nodes marked as dev-only unless dev mode is enabled",
|
||||
"hideSubgraph": "Hide Subgraph Nodes",
|
||||
"hideSubgraphDescription": "Temporarily hides subgraph nodes from node library and search"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import _ from 'es-toolkit/compat'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref, watchEffect } from 'vue'
|
||||
|
||||
import { t } from '@/i18n'
|
||||
import { isProxyWidget } from '@/core/graph/subgraph/proxyWidget'
|
||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||
@@ -428,25 +429,24 @@ export const useNodeDefStore = defineStore('nodeDef', () => {
|
||||
// Deprecated nodes filter
|
||||
registerNodeDefFilter({
|
||||
id: 'core.deprecated',
|
||||
name: 'Hide Deprecated Nodes',
|
||||
description: 'Hides nodes marked as deprecated unless explicitly enabled',
|
||||
name: t('nodeFilters.hideDeprecated'),
|
||||
description: t('nodeFilters.hideDeprecatedDescription'),
|
||||
predicate: (nodeDef) => showDeprecated.value || !nodeDef.deprecated
|
||||
})
|
||||
|
||||
// Experimental nodes filter
|
||||
registerNodeDefFilter({
|
||||
id: 'core.experimental',
|
||||
name: 'Hide Experimental Nodes',
|
||||
description:
|
||||
'Hides nodes marked as experimental unless explicitly enabled',
|
||||
name: t('nodeFilters.hideExperimental'),
|
||||
description: t('nodeFilters.hideExperimentalDescription'),
|
||||
predicate: (nodeDef) => showExperimental.value || !nodeDef.experimental
|
||||
})
|
||||
|
||||
// Dev-only nodes filter
|
||||
registerNodeDefFilter({
|
||||
id: 'core.dev_only',
|
||||
name: 'Hide Dev-Only Nodes',
|
||||
description: 'Hides nodes marked as dev-only unless dev mode is enabled',
|
||||
name: t('nodeFilters.hideDevOnly'),
|
||||
description: t('nodeFilters.hideDevOnlyDescription'),
|
||||
predicate: (nodeDef) => showDevOnly.value || !nodeDef.dev_only
|
||||
})
|
||||
|
||||
@@ -454,9 +454,8 @@ export const useNodeDefStore = defineStore('nodeDef', () => {
|
||||
// Filter out litegraph typed subgraphs, saved blueprints are added in separately
|
||||
registerNodeDefFilter({
|
||||
id: 'core.subgraph',
|
||||
name: 'Hide Subgraph Nodes',
|
||||
description:
|
||||
'Temporarily hides subgraph nodes from node library and search',
|
||||
name: t('nodeFilters.hideSubgraph'),
|
||||
description: t('nodeFilters.hideSubgraphDescription'),
|
||||
predicate: (nodeDef) => {
|
||||
// Hide subgraph nodes (identified by category='subgraph' and python_module='nodes')
|
||||
return !(
|
||||
|
||||
Reference in New Issue
Block a user